From 7ec2538005c4682ec1bc756125b7eba48b63494b Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Sun, 21 Oct 2012 15:46:03 -0400 Subject: [PATCH] added "list" builtin --- proc.go | 6 ++---- skeam.go | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/proc.go b/proc.go index a069457..0986ceb 100644 --- a/proc.go +++ b/proc.go @@ -107,8 +107,6 @@ func length(vals []interface{}) (interface{}, error) { return len(x), nil } -/* -func car(vals []interface{}) (interface{}, error) { - +func list(vals []interface{}) (interface{}, error) { + return sexp(vals), nil } -*/ diff --git a/skeam.go b/skeam.go index 277f2f6..4f29889 100644 --- a/skeam.go +++ b/skeam.go @@ -28,13 +28,14 @@ var universe = &environment{map[symbol]interface{}{ "*": builtin(multiplication), "/": builtin(division), "length": builtin(length), + "list": builtin(list), "not": builtin(not), + "begin": special(begin), "define": special(define), - "quote": special(quote), "if": special(_if), - "set!": special(set), "lambda": special(mklambda), - "begin": special(begin), + "quote": special(quote), + "set!": special(set), }, nil} // parses the string lexeme into a value that can be eval'd