macro
(setf (get-macro-spec name macro-env-dict)
(cons nil (eval (make-ps-macro-function arglist body))))))
- (compile-parenscript-form `(progn ,@body))))
+ (compile-parenscript-form `(progn ,@body) :expecting expecting)))
(define-ps-special-form symbol-macrolet (symbol-macros &body body)
(with-temp-macro-environment (macro-env-dict)
macro
(setf (get-macro-spec name macro-env-dict)
(cons t (lambda (x) (declare (ignore x)) expansion)))))
- (compile-parenscript-form `(progn ,@body))))
+ (compile-parenscript-form `(progn ,@body) :expecting expecting)))
(define-ps-special-form defmacro (name args &body body) ;; should this be a macro?
(eval `(defpsmacro ,name ,args ,@body))
(test-ps-js symbol-macrolet-var
(symbol-macrolet ((x y))
(var x))
- "var y;")
\ No newline at end of file
+ "var y;")
+
+(test-ps-js setf-conditional1
+ (setf x (unless (null a) (1+ a)))
+ "x = a != null ? a + 1 : null;")
+
+(test-ps-js setf-let1
+ (setf x (let ((a 1)) a))
+ "x = (a1 = 1, a1);")
+
+(test-ps-js setf-let2
+ (setf x (let ((a (foo)))
+ (unless (null a)
+ (1+ a))))
+ "x = (a1 = foo(), a1 != null ? a1 + 1 : null);")