From c7c503044eda90020ad2d445caddc7c1168beff0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Sat, 22 Jun 2013 01:19:06 +0200 Subject: [PATCH] Fix object dumping --- src/compiler.lisp | 6 +++--- src/print.lisp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index 44ccbe7..2edc334 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -116,7 +116,7 @@ (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) @@ -497,7 +497,7 @@ (defvar *literal-counter* 0) (defun genlit () - (format nil "l~d" (incf *literal-counter*))) + (code "l" (incf *literal-counter*))) (defun dump-symbol (symbol) #-jscl @@ -1005,7 +1005,7 @@ (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!';") diff --git a/src/print.lisp b/src/print.lisp index a8ac834..db3be82 100644 --- a/src/print.lisp +++ b/src/print.lisp @@ -289,7 +289,8 @@ (concatf res (format-special next (car arguments))) (pop arguments)))) (setq res (concat res (string c)))) - (incf i))) + (incf i)) + (/debug res)) (if destination (progn (write-string res) -- 1.7.10.4