; (DEFPSMACRO name lambda-list macro-body)
; (MACROLET ({name lambda-list macro-body}*) body)
; (SYMBOL-MACROLET ({name macro-body}*) body)
-; (PS-GENSYM {string}?)
+; (PS-GENSYM {string})
;
; name ::= a Lisp symbol
; lambda-list ::= a lambda list
(defprinter unary-operator (op arg &key prefix)
(when prefix
(write-string op))
- (if (eql 'operator (car arg))
+ (if (and (listp arg) (eql 'operator (car arg)))
(parenthesize-print arg)
(ps-print arg))
(unless prefix
(decf foo bar)
"foo -= bar")
+(test-ps-js incf2
+ (incf x 5)
+ "x += 5")
+
+(test-ps-js decf2
+ (decf y 10)
+ "y -= 10")
+
(test-ps-js setf-conditional
(setf foo (if x 1 2))
"foo = x ? 1 : 2;")
img))
img))
"document.write(LINKORNOT == 1 ? '<a href=\"#\" onclick=\"' + 'javascript:transport();' + '\">' + img + '</a>' : img)")
+
+(test-ps-js negate-number-literal ;; ok, this was broken and fixed before, but no one bothered to add the test!
+ (- 1)
+ "-1")