Double floats cause issues with the compiler
md> (setf *read-default-float-format* 'double-float) double-float md> (ps '(1.0 2.0 3.0)) "[1.0D0, 2.0D0, 3.0D0];"
since 1.0D0 isn't javascript
This is a simpler example:
md> (ps 1.0D0) "1.0D0;"
Adding...
(defmethod ps-print ((x double-float)) (format *psw-stream* "~F" (coerce x 'single-float)))
to printer.lisp resolves the problem.
At which point it's tempting to rework the ps-print method on number with:
(defmethod ps-print ((x double-float)) (format *psw-stream* "~F" (coerce x 'single-float)))
(defmethod ps-print ((x integer)) (format *psw-stream* "~D" x))
(defmethod ps-print ((x number)) (format *psw-stream* "~F" x))
Thanks for this awesome tool! - ben