Re: Printing promises

2010-03-22 Thread Konrad Hinsen
On 22 Mar 2010, at 07:43, Meikel Brandmeyer wrote: No. The "problem" is, that for each type there is a unique print- method installed by deftype. You have to re-define this method and call the method for clojure.lang.IDeref directly. (See also above paste.) It may be easier to do a (r

Re: Printing promises

2010-03-22 Thread Per Vognsen
On Mon, Mar 22, 2010 at 1:43 PM, Meikel Brandmeyer wrote: > Hi, > > On Mar 22, 7:13 am, Per Vognsen wrote: > >> As a solution, I factored the reify out into a deftype: >> >> http://gist.github.com/339834 > > A short note: you don't have to use :keyword notation in the methods. > The attributes of

Re: Printing promises

2010-03-21 Thread Meikel Brandmeyer
Hi, On Mar 22, 7:13 am, Per Vognsen wrote: > As a solution, I factored the reify out into a deftype: > > http://gist.github.com/339834 A short note: you don't have to use :keyword notation in the methods. The attributes of the type are available under their names. See here: http://paste.pocoo.o

Printing promises

2010-03-21 Thread Per Vognsen
The print-method for IDerefs by default dereferences anything to be printed. Right now it has a special type check for futures but not for promises. It makes promises nearly impossible to debug or to use from the REPL. The current implementation of promises uses reify rather than deftype, so there