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
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
> (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
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
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
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
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
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
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
I'm wondering if it's possible to create a Clojure function that does what
the dot operator does. It seems like this would be possible with definline
but I'm unable to get this to work or figure it out. For example I want to
be able write something like the following:
(dot "Hello world" (list 'sub
10 matches
Mail list logo