projects
/
jscl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New functions: copy-list, identity
[jscl.git]
/
ecmalisp.lisp
diff --git
a/ecmalisp.lisp
b/ecmalisp.lisp
index
e4dba1b
..
be51b2d
100644
(file)
--- a/
ecmalisp.lisp
+++ b/
ecmalisp.lisp
@@
-283,6
+283,11
@@
(cons (funcall func (car list))
(mapcar func (cdr list)))))
(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))
(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)
(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*)))
(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)
"eval.apply(window, [string])"))
(define-builtin error (string)
- (concat "(function (){ throw " string ";" "return 0;})()"))
+ (concat "(function (){ throw " string "; })()"))
(define-builtin new () "{}")
(define-builtin new () "{}")
@@
-1297,4
+1302,8
@@
(setq *compilation-unit-checks* nil))))
(defun bootstrap ()
(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")))
(ls-compile-file "ecmalisp.lisp" "ecmalisp.js")))