I'm sorry. A small correction regarding the last post:

--------------------------------------------------------

A simple question (especially for Rich):

why not simply make

`(x1 x2 x3 ... xn)

expand to

(clojure.core/apply clojure.core/list (clojure.core/seq (clojure.core/
concat |x1| |x2| |x3| ... |xn|)) ?

That way the symmetry is restored and the rules are much simpler.

--------------------------------------------------------

Rock


On Jun 1, 4:59 pm, Rock <rocco.ro...@gmail.com> wrote:
> I've been working on the Wiki lately and I'm stuck on the part about
> syntax-quotes (that I had already written) which required some
> updating.
>
> There have been some changes (linked to fully lazy sequences I
> suppose) with the way syntax-quotes are expanded.
>
> It used to work like this:
>
> ------------------------------
>
> For Lists, 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)
>
> is interpreted to mean
>
> (clojure.core/concat |x1| |x2| |x3| ... |xn|)
>
> where the | | 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.
>
> If the syntax-quote syntax is nested, the innermost syntax-quoted form
> is expanded first. This means that if several ~ occur in a row, the
> leftmost one belongs to the innermost syntax-quote.
>
> ------------------------------
>
> but now
>
> `(x1 x2 x3 ... xn)
>
> is interpreted to mean
>
> (clojure.core/seq (clojure.core/concat |x1| |x2| |x3| ... |xn|))
>
> [ Rich PLEASE explain why the change ]
>
> There's nothing shocking about that except for this peculiar behavior:
>
> `()
>
> is expanded to
>
> (clojure.core/list)
>
> instead of (what you would expect following the rule):
>
> (clojure.core/seq (clojure.core/concat))
>
> Of course the latter would produce nil which is WRONG, so this
> asymmetry was introduced (which was NOT there in the past because it
> would have been: (clojure.core/concat (clojure.core/list)) ).
>
> But that's not the end of it. If you do
>
> `[]
>
> you get:
>
> (clojure.core/apply clojure.core/vector (clojure.core/seq
> (clojure.core/concat)))
>
> instead of (what you would expect and is EQUIVALENT):
>
> (clojure.core/vector)
>
> The same for the other analogous data structures.
>
> Now, that does seem a little bizarre.
>
> A simple question (especially for Rich):
>
> why not simply make
>
> `(x1 x2 x3 ... xn)
>
> expand to
>
> (clojure.core/apply clojure.core/list (clojure.core/seq (clojure.core/
> concat))) ?
>
> That way the symmetry is restored and the rules are much simpler.
>
> Rock
--~--~---------~--~----~------------~-------~--~----~
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 - please be patient with your 
first post.
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