On 14 Gen, 17:58, Chouser <chou...@gmail.com> wrote:
> On Wed, Jan 14, 2009 at 6:07 AM, Rock <rocco.ro...@gmail.com> wrote:
>
> [snip]
>
> > #^{:ack bar} foo      ; (clojure/with-meta foo {:ack bar})
>
> This is not correct, and a common misunderstanding.
>
> "#^ is not sugar for with-meta. It does not expand into a call to
> with- meta. They are not equivalent."
>
> http://groups.google.com/group/clojure/msg/919455504c57659e
>
> > The #() syntax is intended for very short functions being passed as
> > arguments. It takes parameters named %, %2, %3, %n ... %&.
>
> Might be worth mentioning that it cannot be nested.
>
> > `meow    ; (quote cat/meow) ...assuming we are in the namespace cat
>
> assming 'meow' is defined in namespace "cat", not that *ns* is
> currently "cat"
>
> > If a symbol is non-namespace-qualified and ends with '#', it is
> > resolved to a generated symbol with the same name to which '_' and a
> > unique id have been appended. e.g. x# will resolve to x_123. All
> > references to that symbol within a syntax-quoted expression resolve to
> > the same generated symbol.
>
> All references to that symbol within THE SAME syntax-quoted expression...

I didn't write the section above, but I included it for completeness.
I'll see what I can do, thanks for the clarifications. I'm still
waiting approval for my own modifications :)

What follows is my own contribution:

>
>
>
> > For Lists/Vectors/Maps, syntax-quote establishes a template of the
> > corresponding data structure. Within the template, unqualified forms
> > behave as if recursively syntax-quoted.
>
> > `(x1 x2 x3 ... xn)
>
> > may be interpreted to mean
>
> > (clojure.core/concat [x1] [x2] [x3] ... [xn])
>
> > where the brackets are used to indicate a transformation of an xj as
> > follows:
>
> >    * [form] is interpreted as (clojure.core/list `form), which
> > contains a syntax-quoted form that must then be further interpreted.
>
> >    * [~form] is interpreted as (clojure.core/list form).
>
> >    * [...@form] is interpreted as form.
>
> I'm not quite sure I follow the above section.
>
> Ok, after a bit more pondering, I guess I see what you're saying.
> That in your own little notation here, if [x1] is actually [~form], by
> which you mean the original expression is `(~myform), then that's the
> same as (concat (list myform)) ?  I'm not sure that particular
> mechanism for explanation is simple enough to be worth including.
>

Thanks for pointing that out! Sorry, still feeling the influence of
CL. I realize [ ] are for vectors in Clojure. I've already corrected
that, replacing the [ ] with | | ... this was adapted from the CL
HyperSpec by the way.

> > ``(~~a)
>
> Yikes, I've never tried to do that.
>
> > At this time, Clojure does not allow you to define your own reader
> > macros, but this may change in the future.
>
> You're more hopeful on this point than I am. :-)
>
> Thanks for writing this up.

You're very welcome. Thank you for your precious tips.

> --Chouser
--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to