|
|
|
@ -21,9 +21,12 @@ func (s sexp) String() string {
|
|
|
|
|
type symbol string
|
|
|
|
|
|
|
|
|
|
var universe = &environment{map[symbol]interface{}{
|
|
|
|
|
// predefined values
|
|
|
|
|
"#t": true,
|
|
|
|
|
"#f": false,
|
|
|
|
|
"null": nil,
|
|
|
|
|
|
|
|
|
|
// builtin functions
|
|
|
|
|
"+": builtin(addition),
|
|
|
|
|
"-": builtin(subtraction),
|
|
|
|
|
"*": builtin(multiplication),
|
|
|
|
@ -33,6 +36,9 @@ var universe = &environment{map[symbol]interface{}{
|
|
|
|
|
"list?": builtin(islist),
|
|
|
|
|
"not": builtin(not),
|
|
|
|
|
"null?": builtin(isnull),
|
|
|
|
|
"symbol?": builtin(issymbol),
|
|
|
|
|
|
|
|
|
|
// special forms
|
|
|
|
|
"begin": special(begin),
|
|
|
|
|
"define": special(define),
|
|
|
|
|
"if": special(_if),
|
|
|
|
|