X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=ecmalisp.lisp;h=be51b2d68de9bddbf2c9feac0d85930e15e7e8fe;hb=b373038d138b8cf9e418636e338383130c225cdd;hp=e4dba1b0be8c1180db3d1c24a3cf97b4ed750909;hpb=2d227431f8ee11c329cb0f4981386f67fb912a43;p=jscl.git diff --git a/ecmalisp.lisp b/ecmalisp.lisp index e4dba1b..be51b2d 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -283,6 +283,11 @@ (cons (funcall func (car list)) (mapcar func (cdr list))))) + (defun identity (x) x) + + (defun copy-list (x) + (mapcar #'identity x)) + (defun code-char (x) x) (defun char-code (x) x) (defun char= (x y) (= x y)) @@ -725,7 +730,7 @@ (push (concat "var " (binding-translation b)) *toplevel-compilations*))) (defun %compile-defun (name) - (let ((b (lookup-function name *env*))) + (let ((b (lookup-function name *fenv*))) (mark-binding-as-declared b) (push (concat "var " (binding-translation b)) *toplevel-compilations*))) @@ -1148,7 +1153,7 @@ "eval.apply(window, [string])")) (define-builtin error (string) - (concat "(function (){ throw " string ";" "return 0;})()")) + (concat "(function (){ throw " string "; })()")) (define-builtin new () "{}") @@ -1297,4 +1302,8 @@ (setq *compilation-unit-checks* nil)))) (defun bootstrap () + (setq *variable-counter* 0 + *gensym-counter* 0 + *function-counter* 0 + *literal-counter* 0) (ls-compile-file "ecmalisp.lisp" "ecmalisp.js")))