Lisp-2 removal (part one)
authorClinton Ebadi <clinton@unknownlamer.org>
Thu, 8 Oct 2009 19:23:15 +0000 (15:23 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Thu, 8 Oct 2009 19:23:15 +0000 (15:23 -0400)
* Remove `flet', `function', and `funcall' special forms/macros
* `js::funcall' is kept because it makes the AST a bit easier to work
  with, but this is for internal use only

src/compiler.lisp
src/package.lisp
src/printer.lisp
src/special-forms.lisp

index 115d067..f3d9d24 100644 (file)
@@ -298,7 +298,7 @@ the form cannot be compiled to a symbol."
        `(js:variable ,(maybe-rename-local-function name))))
 
 (defun compile-funcall-form (form)
-  `(js:funcall
+  `(js::funcall
     ,(if (symbolp (car form))
          (function-name->js-expression (car form))
          (ps-compile-expression (ps-macroexpand (car form))))
index 4173e9e..4e04212 100644 (file)
       ;; function definition
       #:defun
       #:lambda
-      #:flet
       #:labels
 
       ;; lambda lists
       #:object
       #:variable
       #:slot-value
-      #:funcall
       #:escape
       ))
   )
index b45f1c6..6712fe0 100644 (file)
@@ -167,7 +167,7 @@ arguments, defines a printer for that form using the given body."
       (ps-print arg))
   (unless prefix (format *psw-stream* "~(~a~)" op)))
 
-(defprinter js:funcall (fun-designator &rest args)
+(defprinter js::funcall (fun-designator &rest args)
   (funcall (if (member (car fun-designator) '(js:variable js:aref js:slot-value js:funcall))
                #'ps-print
                #'parenthesize-print)
index b495fe9..7109cf5 100644 (file)
@@ -372,16 +372,6 @@ lambda-list::=
     `(%js-lambda ,effective-args
       ,@effective-body)))
 
-(define-ps-special-form flet (fn-defs &rest body)
-  (let ((fn-renames (make-macro-dictionary)))
-    (loop for (fn-name) in fn-defs do
-         (setf (gethash fn-name fn-renames) (ps-gensym fn-name)))
-    (let ((fn-defs (ps-compile
-                    `(progn ,@(loop for (fn-name . def) in fn-defs collect
-                                   `(var ,(gethash fn-name fn-renames) (lambda ,@def))))))
-          (*ps-local-function-names* (cons fn-renames *ps-local-function-names*)))
-      (append fn-defs (cdr (ps-compile `(progn ,@body)))))))
-
 (define-ps-special-form labels (fn-defs &rest body)
   (with-local-macro-environment (local-fn-renames *ps-local-function-names*)
     (loop for (fn-name) in fn-defs do
@@ -391,9 +381,6 @@ lambda-list::=
                     `(var ,(gethash fn-name local-fn-renames) (lambda ,@def)))
              ,@body))))
 
-(define-ps-special-form function (fn-name)
-  (ps-compile (maybe-rename-local-function fn-name)))
-
 (defvar *defun-setf-name-prefix* "__setf_")
 
 (defpsmacro defun-setf (setf-name lambda-list &body body)
@@ -431,9 +418,6 @@ lambda-list::=
 (defpsmacro defsetf (access-fn &rest args)
   `(,(if (= (length args) 3) 'defsetf-long 'defsetf-short) ,access-fn ,@args))
 
-(defpsmacro funcall (&rest arg-form)
-  arg-form)
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; macros
 (define-ps-special-form macrolet (macros &body body)