Wow, I've never seen ~' before. But it works great. Thanks a lot.
On May 9, 5:41 am, Konrad Hinsen <[email protected]> wrote:
> On 09.05.2009, at 03:50, samppi wrote:
>
> > I'm trying to use m-plus inside a macro like this:
>
> > (defmacro alt
> > [& subrules]
> > (with-monad parser-m
> > `(fn [state#]
> > ((m-plus ~...@subrules) state#))))
>
> > Unfortunately, I get the error:
> > No such var: my-namespace.fnparse/m-plus
>
> Write ~'m-plus instead of m-plus. That protects the symbol from being
> namespace-qualified by syntax-quote (`), and permits it to be bound
> by the let form that with-monad expands into.
>
> Now that monads use symbol macros (a change that's a few days old),
> it may be possible to make the four monad operations m-result, m-
> bind, m-zero, and m-plus normal namespace-qualified symbols in
> clojure.contrib.monads. I will look into this. A more uniform access
> would certainly make their use easier to understand.
>
> Konrad.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---