Re: ClojureScript and macros - Please explain

2012-04-06 Thread aki
A call to the snippets macro will be expanded to a map literal. The calls to the snippet function inside the snippets macro will be executed at macro expansion time. This use of macros is a very clever hack to get some strings containing HTML into the compiled JS, but it's probably not a great

Re: ClojureScript and macros - Please explain

2012-04-06 Thread aki
Hm I tried to respond to this just now but I think I accidentally deleted my post, or at least I hope so and I wasn't breaking some etiquette and being modded. The snippets macro expands into a map literal, and the snippet function will be executed at macro expansion time. You can see this by c

ClojureScript and macros - Please explain

2012-04-06 Thread Duraid
In this doc ( https://github.com/brentonashworth/one/wiki/Design-and-templating) under 'Including templates in the application' it says: * In ClojureScript, macros are Clojure macros and run only at compile time. This means we can use any Clojure library from a macro. * * * The way I understand

Re: please explain where and why to use var-quote

2010-08-04 Thread Nicolas Oury
2010/8/4 limux : > Thanks for your very very helpful help. > >  I want to do something like rails's activerecord orm, > The following is the primary idea: > > (defmacro defmodel [model-name] >   `(let [temp# ~(symbol (str "app.model." model-name))] >       (do >           ;; create the namespace ac

Re: please explain where and why to use var-quote

2010-08-04 Thread limux
Thanks for your very very helpful help. I want to do something like rails's activerecord orm, The following is the primary idea: (defmacro defmodel [model-name] `(let [temp# ~(symbol (str "app.model." model-name))] (do ;; create the namespace according to model name

Re: please explain where and why to use var-quote

2010-08-04 Thread limux
Thanks for your very very helpful help. Another question is: defmacro defmodel [model-name] `(let [sym-model-name ~(symbol (str "app.model." model-name))] (do On 8月4日, 下午3时42分, Meikel Brandmeyer wrote: > Hi, > > On Aug 4, 9:32 am, limux wrote: > > > i very confused var-quote, hope som

Re: please explain where and why to use var-quote

2010-08-04 Thread Meikel Brandmeyer
Hi, On Aug 4, 9:32 am, limux wrote: > i very confused var-quote, hope someone explain it more detailed than > the clojure.org's, thks. Global values are stored in so-called Vars. Symbols are used in program code to link to those Vars, ie. to basically give them a name. So the addition function

please explain where and why to use var-quote

2010-08-04 Thread limux
i very confused var-quote, hope someone explain it more detailed than the clojure.org's, thks. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated

Re: Please explain

2009-02-27 Thread Michael Wood
On Fri, Feb 27, 2009 at 2:30 PM, Mark Volkmann wrote: > > On Fri, Feb 27, 2009 at 4:34 AM, Michael Wood wrote: [...] >> Bindings created with binding can be assigned to, which provides a >> means for nested contexts to communicate with code before it _in_ the call >> stack. [...] > > The word "b

Re: Please explain

2009-02-27 Thread Mark Volkmann
On Fri, Feb 27, 2009 at 4:34 AM, Michael Wood wrote: > > On Fri, Feb 27, 2009 at 11:08 AM, timc wrote: >> >> On the page describing Vars, I cannot get the meaning of this sentence >> (a typo has made it incomprehensible I think): >> >> "Bindings created with binding can be assigned to, which pro

Re: Please explain

2009-02-27 Thread Michael Wood
On Fri, Feb 27, 2009 at 11:08 AM, timc wrote: > > On the page describing Vars, I cannot get the meaning of this sentence > (a typo has made it incomprehensible I think): > > "Bindings created with binding can be assigned to, which provides a > means for nested contexts to communicate with code be

Re: Please explain

2009-02-27 Thread Jason Wolfe
Here's an example: user> (def x) #'user/x user> (defn foo [] (set! x 10)) #'user/foo user> (binding [x 1] [x (binding [x 2] [x (do (foo) x)]) x]) [1 [2 10] 1] Foo passes information to the calling form by assigning to x, within the innermost binding only. It sounds like the quote should say "

Please explain

2009-02-27 Thread timc
On the page describing Vars, I cannot get the meaning of this sentence (a typo has made it incomprehensible I think): "Bindings created with binding can be assigned to, which provides a means for nested contexts to communicate with code before it the call stack." Thanks --~--~-~--~~-