Re: Help with the dot operator special form

2009-03-22 Thread David Nolen
Thanks again to all for the help, clj-cont now supports the new and dot special forms. This also means that dosync, doto, .. all work perfectly fine from within a with-call-cc form. You can now write things like this: (let [cc (atom nil)] [(with-call-cc (. (let-cc k (reset! cc k) (k

Re: Help with the dot operator special form

2009-03-22 Thread David Nolen
That was it! At one point I knew these things. Thanks much. On Sun, Mar 22, 2009 at 2:18 PM, Eric Tschetter wrote: > > > (let [myref (ref {})] > > (dot > >clojure.lang.LockingTransaction > >(list 'runInTransaction (fn [] (commute myref assoc :mykey :myval) > > I'm getting a instanc

Re: Help with the dot operator special form

2009-03-22 Thread Eric Tschetter
> (let [myref (ref {})] >   (dot >    clojure.lang.LockingTransaction >    (list 'runInTransaction (fn [] (commute myref assoc :mykey :myval) > I'm getting a instance method not found exception which seems odd. I looked > at LockingTransaction.java and I see that runInTransaction does in fact

Re: Help with the dot operator special form

2009-03-22 Thread David Nolen
Thanks all for the pointers, this looks like a workable approach. In my case I'm not bothered by the performance hit from reflection (CPS transformation creates an obscene number of anonymous functions anyway). However I am running into an issue. Here's my dot function: (def not-seq? (comp not se

Re: Help with the dot operator special form

2009-03-22 Thread Stuart Sierra
On Mar 21, 10:23 pm, Timothy Pratley wrote: > You may be able to achieve what you want by directly accessing > Clojure's reflector class instead of using the special form: You could also call Java's reflection API directly. -Stuart Sierra --~--~-~--~~~---~--~~ Yo

Re: Help with the dot operator special form

2009-03-21 Thread Timothy Pratley
You may be able to achieve what you want by directly accessing Clojure's reflector class instead of using the special form: user=> (clojure.lang.Reflector/invokeInstanceMethod "Hello" "substring" (to-array [1 2])) "e" There is also invokeStaticMethod (and others). Regards, Tim. On Mar 22, 12

Re: Help with the dot operator special form

2009-03-21 Thread David Nolen
Or rather I did not express that requirement clearly enough. On Sat, Mar 21, 2009 at 9:21 PM, David Nolen wrote: > On Sat, Mar 21, 2009 at 9:10 PM, Kevin Downey wrote: > >> >> you want defmacro not definline. the result of a macro is a data >> structure. that data structure is then evaluated in

Re: Help with the dot operator special form

2009-03-21 Thread David Nolen
On Sat, Mar 21, 2009 at 9:10 PM, Kevin Downey wrote: > > you want defmacro not definline. the result of a macro is a data > structure. that data structure is then evaluated in place of the call > to the macro. definline (I think?) behaves similar to a function, so > if it returns a data structure

Re: Help with the dot operator special form

2009-03-21 Thread Kevin Downey
you want defmacro not definline. the result of a macro is a data structure. that data structure is then evaluated in place of the call to the macro. definline (I think?) behaves similar to a function, so if it returns a data structure, you just get that data structure (the data structure is not th