added "list" builtin

master
Jordan Orelli 12 years ago
parent a4e7333f86
commit 7ec2538005

@ -107,8 +107,6 @@ func length(vals []interface{}) (interface{}, error) {
return len(x), nil return len(x), nil
} }
/* func list(vals []interface{}) (interface{}, error) {
func car(vals []interface{}) (interface{}, error) { return sexp(vals), nil
} }
*/

@ -28,13 +28,14 @@ var universe = &environment{map[symbol]interface{}{
"*": builtin(multiplication), "*": builtin(multiplication),
"/": builtin(division), "/": builtin(division),
"length": builtin(length), "length": builtin(length),
"list": builtin(list),
"not": builtin(not), "not": builtin(not),
"begin": special(begin),
"define": special(define), "define": special(define),
"quote": special(quote),
"if": special(_if), "if": special(_if),
"set!": special(set),
"lambda": special(mklambda), "lambda": special(mklambda),
"begin": special(begin), "quote": special(quote),
"set!": special(set),
}, nil} }, nil}
// parses the string lexeme into a value that can be eval'd // parses the string lexeme into a value that can be eval'd

Loading…
Cancel
Save