(defun toplevel-compilation (string)
(push string *toplevel-compilations*))
-(defun null-or-empty-p (x)
- (zerop (length x)))
-
(defun get-toplevel-compilations ()
- (reverse (remove-if #'null-or-empty-p *toplevel-compilations*)))
+ (reverse *toplevel-compilations*))
(defun %compile-defmacro (name lambda)
(toplevel-compilation (ls-compile `',name))
(if *compiling-file*
(progn
(eval (cons 'progn body))
- nil)
+ (ls-compile 0))
(ls-compile `(progn ,@body))))
(defmacro define-transformation (name args form)
(ls-compile (car body) *multiple-value-p*)
(code "("
(join
- (remove-if #'null-or-empty-p
- (append
- (mapcar #'ls-compile (butlast body))
- (list (ls-compile (car (last body)) t))))
+ (append
+ (mapcar #'ls-compile (butlast body))
+ (list (ls-compile (car (last body)) t)))
",")
")")))
(code (ls-compile-block (butlast sexps) nil decls-allowed-p)
"return " (ls-compile (car (last sexps)) *multiple-value-p*) ";")
(join-trailing
- (remove-if #'null-or-empty-p (mapcar #'ls-compile sexps))
+ (mapcar #'ls-compile sexps)
(concat ";" *newline*)))))
(defun ls-compile (sexp &optional multiple-value-p)
(let ((subs (mapcar (lambda (s)
(ls-compile-toplevel s t))
(cdr sexp))))
- (join (remove-if #'null-or-empty-p subs))))
+ (join subs)))
(t
(when *compile-print-toplevels*
(let ((form-string (prin1-to-string sexp)))