bug report : cl-format

32 views
Skip to first unread message

Carlos Ungil

unread,
Apr 3, 2011, 4:49:56 PM4/3/11
to clo...@googlegroups.com
Hello,

I don't know if there is a better way to file bug reports (if there is one, it's not easy to find).

(use 'clojure.pprint)

(let [x 111.11111]
  (doseq [fmt ["~3f~%" "~4f~%" "~5f~%" "~6f~%"]]
    (cl-format true fmt x)))

;; 111.11111
;; 111.11111
;; 111.1
;; 111.11

There is clearly a problem in the first two cases, too many digits are being printed.

For reference, this is what common lisp does:

(let ((x 111.11111))
  (loop for fmt  in '("~3f~%" "~4f~%" "~5f~%" "~6f~%")
do (format t fmt x)))

;; 111.
;; 111.
;; 111.1
;; 111.11

Cheers,

Carlos


Tom Faulhaber

unread,
Apr 5, 2011, 2:10:09 AM4/5/11
to Clojure
Hi Carlos,

This certainly looks like a bug. I've filed issue 768 on myself
(http://dev.clojure.org/jira/browse/CLJ-768) and I'll take a look as
soon as I get a chance.

Thanks for bringing this up,

Tom
Reply all
Reply to author
Forward
0 new messages