Re: Redefining Special Forms

2009-09-18 Thread Constantine Vetoshev
On Sep 17, 2:55 pm, Chouser wrote: > In a new thread, vars always start with their root binding. > > There's an ongoing discussion about the best way to provide > other options when this is not the desired behavior: > > http://www.assembla.com/spaces/clojure/tickets/170-bound-fn-macro That discu

Re: Redefining Special Forms

2009-09-17 Thread Gorsal
Yes, that would work. I keep forgetting the try finally acts like unwind-protect. Even if the thread is killed the finally process will execute. Ehh... On Sep 17, 5:50 pm, John Harrop wrote: > On Thu, Sep 17, 2009 at 6:15 PM, Gorsal wrote: > > Or maybe i could simply push to the global var and

Re: Redefining Special Forms

2009-09-17 Thread John Harrop
On Thu, Sep 17, 2009 at 6:15 PM, Gorsal wrote: > Or maybe i could simply push to the global var and in addition to the > value use a unique gensymed id. Then once the local binding was done > it would pop until it sees its gensymed id. That would work in the > situation that a local binding faile

Re: Redefining Special Forms

2009-09-17 Thread Gorsal
Or maybe i could simply push to the global var and in addition to the value use a unique gensymed id. Then once the local binding was done it would pop until it sees its gensymed id. That would work in the situation that a local binding failed to pop its own binding. That might work... On Sep 17,

Re: Redefining Special Forms

2009-09-17 Thread Gorsal
Thanks for the replies! Before I start doing something silly, I would like to ask another question. The eventual goal of all of this is to establish bindings which also affect the same global variable in other namespaces (these other namespaces will 100% have the same global variable). In other wo

Re: Redefining Special Forms

2009-09-17 Thread Jarkko Oranen
On Sep 17, 7:33 pm, Gorsal wrote: > Basically i need to redefine the meaning of a special form. While i am > willing to change the name for things like ns to defpackage, i am not > willing to change the name of forms like apply and defn to achieve my > goals. Instead, i would like to redefine t

Re: Redefining Special Forms

2009-09-17 Thread John Harrop
On Thu, Sep 17, 2009 at 2:49 PM, Stuart Sierra wrote: > > On Sep 17, 12:40 pm, Gorsal wrote: > > Oh. And just as a quick other question, do global bindings affect > > threads which are started in the same ns? > > I think threads inherit the bindings in effect when they are created. http://cloju

Re: Redefining Special Forms

2009-09-17 Thread Chouser
On Thu, Sep 17, 2009 at 2:49 PM, Stuart Sierra wrote: > > On Sep 17, 12:40 pm, Gorsal wrote: >> Oh. And just as a quick other question, do global bindings affect >> threads which are started in the same ns? > > I think threads inherit the bindings in effect when they are created. They do not, o

Re: Redefining Special Forms

2009-09-17 Thread Laurent PETIT
2009/9/17 Laurent PETIT > > 2009/9/17 Stuart Sierra > >> >> On Sep 17, 12:40 pm, Gorsal wrote: >> > Oh. And just as a quick other question, do global bindings affect >> > threads which are started in the same ns? >> >> I think threads inherit the bindings in effect when they are created. >> > >

Re: Redefining Special Forms

2009-09-17 Thread Laurent PETIT
2009/9/17 Stuart Sierra > > On Sep 17, 12:40 pm, Gorsal wrote: > > Oh. And just as a quick other question, do global bindings affect > > threads which are started in the same ns? > > I think threads inherit the bindings in effect when they are created. > I would not place 1€ on this assumption

Re: Redefining Special Forms

2009-09-17 Thread Stuart Sierra
On Sep 17, 12:40 pm, Gorsal wrote: > Oh. And just as a quick other question, do global bindings affect > threads which are started in the same ns? I think threads inherit the bindings in effect when they are created. -SS --~--~-~--~~~---~--~~ You received this me

Re: Redefining Special Forms

2009-09-17 Thread Stuart Sierra
On Sep 17, 12:33 pm, Gorsal wrote: > Basically i need to redefine the meaning of a special form. This depends on what you want to redefine. True "special forms" in Clojure -- def if do let quote var fn loop recur throw try . new set! -- cannot be redefined, period. Anything else -- the content

Re: Redefining Special Forms

2009-09-17 Thread Gorsal
Oh. And just as a quick other question, do global bindings affect threads which are started in the same ns? Like (binding [*global* 2] (with-thread (print *global*) ;;prints 2??? )) On Sep 17, 11:33 am, Gorsal wrote: > Basically i need to redefine the meaning of a special form. While i

Redefining Special Forms

2009-09-17 Thread Gorsal
Basically i need to redefine the meaning of a special form. While i am willing to change the name for things like ns to defpackage, i am not willing to change the name of forms like apply and defn to achieve my goals. Instead, i would like to redefine them for my own needs. Of course, i will be us