Patch attached.
Please let me know if you would rather have another solution to this.
Leslie
-------- Original-Nachricht --------
> Datum: Tue, 28 Jun 2011 12:22:49 +0200
> Von: "Leslie P. Polzer" <[email protected]>
> An: [email protected]
> Betreff: [parenscript-devel] Bug in translation of / operator
> Parenscript 2.3:
>
> ? (/ 2)
> 1/2
>
> ? (ps:ps (/ 2))
> "2;"
>
> ;; should be 1/2
>
> Leslie
> --
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
>
> _______________________________________________
> parenscript-devel mailing list
> [email protected]
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
diff --git a/src/printer.lisp b/src/printer.lisp
index 43d6f57..0c13155 100644
--- a/src/printer.lisp
+++ b/src/printer.lisp
@@ -185,6 +185,8 @@ vice-versa.")
(defprinter (ps-js:+ ps-js:- ps-js:* ps-js:/ ps-js:% ps-js:&& ps-js:\|\| ps-js:& ps-js:\| ps-js:-= ps-js:+= ps-js:*= ps-js:/= ps-js:%= ps-js:^ ps-js:<< ps-js:>> ps-js:&= ps-js:^= ps-js:\|= ps-js:= ps-js:in ps-js:> ps-js:>= ps-js:< ps-js:<=)
(&rest args)
+ (when (and (eq op 'ps-js:/) (not (cdr args))) ; implicit reciprocal
+ (setf args (cons 1 args)))
(loop for (arg . remaining) on args do
(print-op-argument op arg)
(when remaining (format *psw-stream* " ~(~A~) " op))))
_______________________________________________
parenscript-devel mailing list
[email protected]
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel