-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
755 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ bindata.go | |
play | ||
.vscode | ||
.idea | ||
a_*.go | ||
core/a_*.go | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file is generated by generate-std.joke script. Do not edit manually! | ||
|
||
package base64 | ||
|
||
import ( | ||
|
||
. "github.com/candid82/joker/core" | ||
) | ||
|
||
var base64Namespace = GLOBAL_ENV.EnsureNamespace(MakeSymbol("joker.base64")) | ||
|
||
var decode_string_ Proc = func(args []Object) Object { | ||
c := len(args) | ||
switch { | ||
case c == 1: | ||
|
||
s := ExtractString(args, 0) | ||
res := base64DecodeString(s) | ||
return MakeString(res) | ||
|
||
default: | ||
PanicArity(c) | ||
} | ||
return NIL | ||
} | ||
|
||
|
||
func init() { | ||
|
||
base64Namespace.ResetMeta(MakeMeta(nil, "Implements base64 encoding as specified by RFC 4648.", "1.0")) | ||
|
||
base64Namespace.InternVar("decode-string", decode_string_, | ||
MakeMeta( | ||
NewListFrom(NewVectorFrom(MakeSymbol("s"))), | ||
`Returns the bytes represented by the base64 string s.`, "1.0")) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// This file is generated by generate-std.joke script. Do not edit manually! | ||
|
||
package json | ||
|
||
import ( | ||
|
||
. "github.com/candid82/joker/core" | ||
) | ||
|
||
var jsonNamespace = GLOBAL_ENV.EnsureNamespace(MakeSymbol("joker.json")) | ||
|
||
var write_string_ Proc = func(args []Object) Object { | ||
c := len(args) | ||
switch { | ||
case c == 1: | ||
|
||
v := ExtractObject(args, 0) | ||
res := writeString(v) | ||
return res | ||
|
||
default: | ||
PanicArity(c) | ||
} | ||
return NIL | ||
} | ||
|
||
var read_string_ Proc = func(args []Object) Object { | ||
c := len(args) | ||
switch { | ||
case c == 1: | ||
|
||
s := ExtractString(args, 0) | ||
res := readString(s) | ||
return res | ||
|
||
default: | ||
PanicArity(c) | ||
} | ||
return NIL | ||
} | ||
|
||
|
||
func init() { | ||
|
||
jsonNamespace.ResetMeta(MakeMeta(nil, "Implements encoding and decoding of JSON as defined in RFC 4627.", "1.0")) | ||
|
||
jsonNamespace.InternVar("write-string", write_string_, | ||
MakeMeta( | ||
NewListFrom(NewVectorFrom(MakeSymbol("v"))), | ||
`Returns the JSON encoding of v.`, "1.0")) | ||
|
||
jsonNamespace.InternVar("read-string", read_string_, | ||
MakeMeta( | ||
NewListFrom(NewVectorFrom(MakeSymbol("s"))), | ||
`Parses the JSON-encoded data and return the result as a Joker value.`, "1.0")) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// This file is generated by generate-std.joke script. Do not edit manually! | ||
|
||
package os | ||
|
||
import ( | ||
"os" | ||
. "github.com/candid82/joker/core" | ||
) | ||
|
||
var osNamespace = GLOBAL_ENV.EnsureNamespace(MakeSymbol("joker.os")) | ||
|
||
var sh_ Proc = func(args []Object) Object { | ||
c := len(args) | ||
switch { | ||
case true: | ||
CheckArity(args, 1,999) | ||
name := ExtractString(args, 0) | ||
arguments := ExtractStrings(args, 1) | ||
res := sh(name, arguments) | ||
return res | ||
|
||
default: | ||
PanicArity(c) | ||
} | ||
return NIL | ||
} | ||
|
||
var env_ Proc = func(args []Object) Object { | ||
c := len(args) | ||
switch { | ||
case c == 0: | ||
|
||
|
||
res := env() | ||
return res | ||
|
||
default: | ||
PanicArity(c) | ||
} | ||
return NIL | ||
} | ||
|
||
var args_ Proc = func(args []Object) Object { | ||
c := len(args) | ||
switch { | ||
case c == 0: | ||
|
||
|
||
res := commandArgs() | ||
return res | ||
|
||
default: | ||
PanicArity(c) | ||
} | ||
return NIL | ||
} | ||
|
||
var exit_ Proc = func(args []Object) Object { | ||
c := len(args) | ||
switch { | ||
case c == 1: | ||
|
||
code := ExtractInt(args, 0) | ||
res := NIL; os.Exit(code) | ||
return res | ||
|
||
default: | ||
PanicArity(c) | ||
} | ||
return NIL | ||
} | ||
|
||
|
||
func init() { | ||
|
||
osNamespace.ResetMeta(MakeMeta(nil, "Provides a platform-independent interface to operating system functionality.", "1.0")) | ||
|
||
osNamespace.InternVar("sh", sh_, | ||
MakeMeta( | ||
NewListFrom(NewVectorFrom(MakeSymbol("name"), MakeSymbol("&"), MakeSymbol("arguments"))), | ||
`Executes the named program with the given arguments. Returns a map with the following keys: | ||
:success - whether or not the execution was successful, | ||
:out - string capturing stdout of the program, | ||
:err - string capturing stderr of the program.`, "1.0")) | ||
|
||
osNamespace.InternVar("env", env_, | ||
MakeMeta( | ||
NewListFrom(NewVectorFrom()), | ||
`Returns a map representing the environment.`, "1.0")) | ||
|
||
osNamespace.InternVar("args", args_, | ||
MakeMeta( | ||
NewListFrom(NewVectorFrom()), | ||
`Returns a sequence of the command line arguments, starting with the program name (normally, joker).`, "1.0")) | ||
|
||
osNamespace.InternVar("exit", exit_, | ||
MakeMeta( | ||
NewListFrom(NewVectorFrom(MakeSymbol("code"))), | ||
`Causes the current program to exit with the given status code.`, "1.0")) | ||
|
||
} |
Oops, something went wrong.