From 3855a35eb4b6faa707956763b5e2a8bc5f414af2 Mon Sep 17 00:00:00 2001 From: Raimon Grau Date: Thu, 13 Dec 2012 03:13:42 +0100 Subject: [PATCH] quote for integers, strings and lists. no symbols --- lispstrack.lisp | 6 ++++++ 1 file changed, 6 insertions(+) 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* '()) -- 1.7.10.4