((null sexp) "undefined")
((integerp sexp) (format nil "~a" sexp))
((stringp sexp) (format nil "\"~a\"" sexp))
+ ((symbolp sexp) (format nil "{name: \"~a\"}" (symbol-name sexp)))
((consp sexp) (concat "{car: "
(literal->js (car sexp))
", cdr: "
(define-compilation cdr (x)
(concat "(" (ls-compile x env fenv) ").cdr"))
+(define-compilation symbol-name (x)
+ (concat "(" (ls-compile x env fenv) ").name"))
+
+
+
(defmacro with-eval-when-compilation (&body body)
`(setq *eval-when-compilations*
(concat *eval-when-compilations* (progn ,@body))))
(incf x)
(debug x)
+;;; Conses
+(debug (cons 1 2))
+(debug (car (cons 1 2)))
+(debug (cdr (cons 1 2)))
+
+;;; Symbols
+(debug (symbol-name 'foo))
+(debug (symbol-name 'foo-bar))
;;; &rest lambda-list
(debug (lambda (x y &rest z) z))
(debug (lambda (x y &rest z) x))
-;;; Conses
-(debug (cons 1 2))
-(debug (car (cons 1 2)))
-(debug (cdr (cons 1 2)))
-
+;; (debug (foo))
;; (eval-when-compile
;; (%compile-defmacro 'defun