Re: format and printf can't be used with BigInt

2011-07-28 Thread Andrea Tortorella
s and data structures, cl-format is what you want, and it > comes with the language.  If you don't want to learn about cl-format, then a > local wrapper around `format` that does whatever you like re: coercions to > standard Java numeric types would be ~3 lines. > > - Chas >

Re: format and printf can't be used with BigInt

2011-07-28 Thread Andrea Tortorella
Thanks for your replies, +1 for enhancing format Maybe it could handle also rationals, converting them to doubles, but it could be to much. On Jul 28, 9:47 am, Sean Corfield wrote: > On Wed, Jul 27, 2011 at 11:48 PM, Tom Faulhaber > wrote: > > FWIW, clojure.pprint.cl-format handles this fine

format and printf can't be used with BigInt

2011-07-27 Thread Andrea Tortorella
Hi everyone, I don't know where to post about bugs (if this is a bug). Anyway in clojure 1.3 with the new numerics: (format "%d" 2N) throws IllegalFormatConversionException, is it a bug? are there any workarounds? -- You received this message because you are subscribed to the Google Groups "Clo

Expanding symbols and expression in macros.

2011-07-13 Thread Andrea Tortorella
I'm not an expert in macros, and maybe this is a stupid question but i think there should be a general pattern for this. I' ve a function: (defn choose* [f & choices] "Applies f to one of the choices" . .) And this macro: (defmacro choose [[c choices] & body] `(choose* (fn [~c] ~@bod

protocols metadata

2010-04-30 Thread Andrea Tortorella
Hi everyone, Reading the documentation I found that except for the docstring there is no way to tell that InternalReduce is a protocol, it's tagged simply as a var. Why don't add a :protocol true to the metadata for protocols like :macro true for macros? Andrea. -- You received this message bec

Re: Protocols and Types

2010-03-03 Thread Andrea Tortorella
I'm not on my machine so i'cant experiment, i tried on #clojure with clojurebot but it's not 1.2, so i ask here, given that a protocol is represented as a simple map, which is the way to know if something is infact a protocol. Or suppose i want to add a function that works on protocols how can i

Protocols and Types

2010-03-03 Thread Andrea Tortorella
Hi everyone, if I run this code: (defprotocol P (foo [x])) (deftype T [] P (foo [] "dummy")) (extends? P T) ;==> nil (satisfies? P T) ;==> nil (extenders P) ;==>nil are they not yet implemented? anyway when I run (type P) ;==> clojure.lang.PersistentArrayMap So the protocol is simply

Re: leiningen with latest clojure

2009-12-19 Thread Andrea Tortorella
too, but still having no success. Andrea. On Dec 19, 3:56 am, "Alex Osborne" wrote: > defn writes: > > On Dec 18, 7:00 am, Andrea Tortorella wrote: > >> I'd like to ask how to use leiningen with the latest clojure > >> development new branch, is this po

leiningen with latest clojure

2009-12-18 Thread Andrea Tortorella
I'm new to the group, I've been following clojure development for a while, and I want to thank rich and you all for the fantastic work. I'd like to ask how to use leiningen with the latest clojure development new branch, is this possible? thanks, Andrea Tortorella -- You receiv