On Sun, 2 May 2010 14:52:17 -0700 (PDT)
Jarkko Oranen <chous...@gmail.com> wrote:
> On May 2, 11:14 pm, Mike Meyer <mwm-keyword-googlegroups.
> 620...@mired.org> wrote:
> > On Sun, 02 May 2010 13:06:56 +1000
> > To get behavior similar to the vector constructs, you want to use
> > list, which works like vector, except returning a list instead of a
> > vector: (list 1 2 3 (print :hello)). It seems that what's missing here
> > is a syntax for (list. I'm not sure it's needed, as it never appeared
> > in LISP, but #[ seems to be the logical candidate:
> >
> > { - hash-map      #{ - hash-set     [ - vector        #[ - list
> 
> Hmmh. I haven't read the discussion very carefully but it seems there
> might be a fundamental misunderstanding here somewhere.

No, just a failure to look past syntax at the implementation.

> The thing is that (foo bar) *is* a list of two symbols, even if not
> quoted. It just so happens that when such a list is passed to the
> evaluator, it evaluates it as a function call. Similarly, [foo bar] is
> *not* a shortcut for (vector foo bar); it *is* a vector of two
> symbols, and vectors just have different evaluation semantics. The
> same applies to sets and maps.

Presumably because the reader returns those structures, and the
evaluator evaluates the symbols they contain, but doesn't do the
implied function call that it does for lists.

> The best you'd get out of a #[foo bar] is a simple reader macro that
> expands to (list foo bar) and that's really just a waste of macro
> characters, not to mention confusing. Or you would have to have a list
> type that isn't evaluated as a function call. But that path leads to
> insanity.

Well, implementing it that way would be easy, but it wouldn't be
right. #[ should cause the reader to emit a list that the evaluator
doesn't treat as a function invocation, not the code to construct
one. Otherwise, the semantics would be wrong.

But you echoed my main concern about it - 50 years of LISP hasn't
caused anyone to want a shorthand for (list .., otherwise it'd be a
standard CLISP reader macro, indicating that "waste of macro
characters" is probably right.

    <mike
-- 
Mike Meyer <m...@mired.org>             http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

-- 
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