While doing image processing in Clojure recently it occured to me that it would be handy to have a specifier suffix for distinguishing between doubles and floats as libraries in this domain often use single precision floats instead of double precision (or mixtures of both).
My code frequently contains things like [(float 0.12) (float 0.33) (float 0.56)]. e.g. image convolution kernels etc. I'd much rather it look like this: [0.12f 0.33f 0.56f] As far as I can tell there's no way to do this with user code. I think it would have to be done within the Clojure runtime by adjusting ListReader.java to change the floating point reader regex and switching on an suffix character. The current behavior is: 123.32M -> BigDecimal 123.32 -> double I propose: 123.32M -> BigDecimal 123.32 -> double 123.32f -> float 123.32d -> double I already have a prototype which implements the literal syntax above. Is this worthwhile pushing this feature for inclusion in Clojure itself? What kind of issues might I be overlooking? About all I can think of is the printer needs to print the "d" or "f" when *print-readably* is non-nil. Matt -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en