(define-compilation quote (sexp)
(lisp->js sexp))
+(define-compilation debug (form)
+ (format nil "console.log(~a)" (ls-compile form env)))
+
(defparameter *env* '())
(defparameter *env-fun* '())
((symbolp sexp) (ls-lookup sexp env))
((integerp sexp) (format nil "~a" sexp))
((stringp sexp) (format nil " \"~a\" " sexp))
- ; list
((listp sexp)
(let ((compiler-func (second (assoc (car sexp) *compilations*))))
(if compiler-func
(with-open-file (out "test.js" :direction :output :if-exists :supersede)
(loop
for x = (read in nil) while x
- do (write-string (ls-compile x) out)))))
+ do (format out "~a;~%" (ls-compile x))))))