(defun gvarname (symbol)
(declare (ignore symbol))
- (format nil "v~d" (incf *variable-counter*)))
+ (code "v" (incf *variable-counter*)))
(defun translate-variable (symbol)
(awhen (lookup-in-lexenv symbol *environment* 'variable)
(defvar *literal-counter* 0)
(defun genlit ()
- (format nil "l~d" (incf *literal-counter*)))
+ (code "l" (incf *literal-counter*)))
(defun dump-symbol (symbol)
#-jscl
(cond
((floatp x) (push (float-to-string x) fargs))
((numberp x) (push (integer-to-string x) fargs))
- (t (let ((v (format nil "x~d" (incf counter))))
+ (t (let ((v (code "x" (incf counter))))
(push v fargs)
(push `(code "var " ,v " = " ,(ls-compile x) ";"
"if (typeof " ,v " !== 'number') throw 'Not a number!';")