X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftoplevel.lisp;h=1fb9d1bddd2d507ccef67558c77611eee4551088;hb=ab354f654ea66e732d3617265ab004f4537c4062;hp=0a5bb07b3ea96d2d9af1422e5017691ed364f8b2;hpb=89ee56f4f8d539db9462f50cbfd2e1b99ceb06d6;p=jscl.git diff --git a/src/toplevel.lisp b/src/toplevel.lisp index 0a5bb07..1fb9d1b 100644 --- a/src/toplevel.lisp +++ b/src/toplevel.lisp @@ -59,14 +59,14 @@ define-symbol-macro defmacro defparameter defun defvar digit-char digit-char-p disassemble do do* documentation dolist dotimes ecase eq eql equal error eval every export expt - fdefinition find-package find-symbol first flet fourth fset + fdefinition find-package find-symbol first flet format fourth fset funcall function functionp gensym get-internal-real-time get-setf-expansion get-universal-time go identity if in-package incf integerp intern keywordp labels lambda last length let let* list list* list-all-packages listp loop make-array make-package make-symbol mapcar member minusp mod multiple-value-bind multiple-value-call multiple-value-list multiple-value-prog1 - nconc nil not nreconc nth nthcdr null numberp or + nconc nil not nreconc nth nthcdr null numberp or otherwise package-name package-use-list packagep parse-integer plusp pop prin1-to-string print proclaim prog1 prog2 progn psetq push quote read-from-string remove remove-if remove-if-not return @@ -79,6 +79,8 @@ (setq *package* *user-package*) +;;; Set some external entry point to the Lisp implementation to the +;;; console. It would not be necessary when FFI is finished. (js-eval "var lisp") (%js-vset "lisp" (new)) (%js-vset "lisp.read" #'ls-read-from-string) @@ -88,25 +90,3 @@ (%js-vset "lisp.evalString" (lambda (str) (eval (ls-read-from-string str)))) (%js-vset "lisp.evalInput" (lambda (str) (eval-interactive (ls-read-from-string str)))) (%js-vset "lisp.compileString" (lambda (str) (ls-compile-toplevel (ls-read-from-string str) t))) - -;; Set the initial global environment to be equal to the host global -;; environment at this point of the compilation. -(eval-when-compile - (toplevel-compilation - (ls-compile `(setq *environment* ',*environment*)))) - -(eval-when-compile - (toplevel-compilation - (ls-compile - `(progn - ,@(mapcar (lambda (s) `(%intern-symbol (%js-vref ,(cdr s)))) - *literal-table*) - (setq *literal-table* ',*literal-table*) - (setq *variable-counter* ,*variable-counter*) - (setq *gensym-counter* ,*gensym-counter*) - (setq *block-counter* ,*block-counter*))))) - -(eval-when-compile - (toplevel-compilation - (ls-compile - `(setq *literal-counter* ,*literal-counter*))))