Re: use namespace locally in a function

2011-11-23 Thread Nils Bertschinger
Clojure is a Lisp, so it should be possible to extend it yourself ... What about something like this? (defmacro locally-using Allows to use symbols from other namespace in the local scope of the macro body. Syntax: (locally-using [symbol*] :from namespace body) [symbols from ns-name

Re: use namespace locally in a function

2011-11-23 Thread Igor TN
Nils, thanks for the insight! I am relatively new to Lisps and your comment is worth analyzing. - Igor On Nov 23, 5:27 pm, Nils Bertschinger nils.bertschin...@googlemail.com wrote: Clojure is a Lisp, so it should be possible to extend it yourself ... What about something like this? (defmacro

Re: use namespace locally in a function

2011-11-22 Thread Sean Corfield
On Tue, Nov 22, 2011 at 2:52 PM, Igor TN igor...@gmail.com wrote: Is it possible to require or use a namespace as metadata inside the function definition? Something like Your looking for the (require ..), (use ..) and (refer ..) functions - see http://clojuredocs.org for details and examples.

Re: use namespace locally in a function

2011-11-22 Thread Sean Corfield
On Tue, Nov 22, 2011 at 3:13 PM, Sean Corfield seancorfi...@gmail.com wrote: On Tue, Nov 22, 2011 at 2:52 PM, Igor TN igor...@gmail.com wrote: Is it possible to require or use a namespace as metadata inside the function definition? Something like Your looking for the (require ..), (use ..)

Re: use namespace locally in a function

2011-11-22 Thread Kevin Downey
On Tue, Nov 22, 2011 at 3:14 PM, Sean Corfield seancorfi...@gmail.com wrote: On Tue, Nov 22, 2011 at 3:13 PM, Sean Corfield seancorfi...@gmail.com wrote: On Tue, Nov 22, 2011 at 2:52 PM, Igor TN igor...@gmail.com wrote: Is it possible to require or use a namespace as metadata inside the

Re: use namespace locally in a function

2011-11-22 Thread Sean Corfield
On Tue, Nov 22, 2011 at 3:18 PM, Kevin Downey redc...@gmail.com wrote: require/use/import etc make global changes to a namespace(compilation environment), best not to hide that inside a function. True. Which is why I went back and re-read the OP's question and realized I'd missed as metadata

Re: use namespace locally in a function

2011-11-22 Thread Kevin Downey
something distasteful I imagine On Tue, Nov 22, 2011 at 3:20 PM, Sean Corfield seancorfi...@gmail.com wrote: On Tue, Nov 22, 2011 at 3:18 PM, Kevin Downey redc...@gmail.com wrote: require/use/import etc make global changes to a namespace(compilation environment), best not to hide that inside a

Re: use namespace locally in a function

2011-11-22 Thread Alex Baranosky
Looks like he'd like to make a namespace available *only* in a local context, which some languages support, like Scala, for one. I never have a need for that, really. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: use namespace locally in a function

2011-11-22 Thread Igor TN
Yes, I meant local context. In principle, this could help to avoid namespacing conflicts in certain cases. But not a big deal, just wondering if the language supports that. Apparently not. Cool with me. Thanks everybody! On Nov 22, 6:59 pm, Alex Baranosky alexander.barano...@gmail.com wrote: