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 wrote: > Clojure is a Lisp, so it should be possible to extend it yourself ... > What about something like this? > > (defmacro locally-using >   "Allows to

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 [*] :from )" [symbols from ns-name & body] (assert

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 wrote: > Looks like he'd like to make a n

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 t

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 wrote: > On Tue, Nov 22, 2011 at 3:18 PM, Kevin Downey 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

Re: use namespace locally in a function

2011-11-22 Thread Sean Corfield
On Tue, Nov 22, 2011 at 3:18 PM, Kevin Downey 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" anyway and now I

Re: use namespace locally in a function

2011-11-22 Thread Kevin Downey
On Tue, Nov 22, 2011 at 3:14 PM, Sean Corfield wrote: > On Tue, Nov 22, 2011 at 3:13 PM, Sean Corfield wrote: >> On Tue, Nov 22, 2011 at 2:52 PM, Igor TN wrote: >>> Is it possible to "require" or "use" a namespace as metadata inside >>> the function definition? Something like >> >> Your looking

Re: use namespace locally in a function

2011-11-22 Thread Sean Corfield
On Tue, Nov 22, 2011 at 3:13 PM, Sean Corfield wrote: > On Tue, Nov 22, 2011 at 2:52 PM, Igor TN 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 - > se

Re: use namespace locally in a function

2011-11-22 Thread Sean Corfield
On Tue, Nov 22, 2011 at 2:52 PM, Igor TN 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. -- Sean A Co

use namespace locally in a function

2011-11-22 Thread Igor TN
Is it possible to "require" or "use" a namespace as metadata inside the function definition? Something like (defn f {:use '[clojure.set]} [] ... ) If yes, can anybody point me where can I find an exact syntax? If no, why not? Thank you, Igor -- You received this message because you are sub