From: Raimon Grau Date: Thu, 13 Dec 2012 02:13:42 +0000 (+0100) Subject: quote for integers, strings and lists. no symbols X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=3855a35eb4b6faa707956763b5e2a8bc5f414af2;p=jscl.git quote for integers, strings and lists. no symbols --- diff --git a/lispstrack.lisp b/lispstrack.lisp index 99a7473..c352d71 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -50,6 +50,12 @@ body can access to the local environment through the variable env" (define-compilation setq (var val) (format nil "~a = ~a" (ls-lookup var env) (ls-compile val env))) +(define-compilation quote (sexp) + (cond + ((integerp sexp) (format nil "~a" sexp)) + ((stringp sexp) (format nil "\"~a\"" sexp)) + ((listp sexp) (format nil "[~{~a~^, ~}]" sexp)))) + (defparameter *env* '()) (defparameter *env-fun* '())