Re: Lisp at sexp's length
From: Rahul Jain (rjain_at_nyct.net)
Date: 12/19/03
- Next message: Rahul Jain: "Re: [OT] Re: Linux & BSD history"
- Previous message: Rahul Jain: "Re: Lisp at sexp's length"
- In reply to: Thomas A. Russ: "Re: Lisp at sexp's length"
- Next in thread: Eric Merritt: "Re: Lisp at sexp's length"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Dec 2003 19:18:19 -0500
tar@sevak.isi.edu (Thomas A. Russ) writes:
> heliosc@mindspring.com (Rayiner Hashem) writes:
>
>>
>> Rahul Jain <rjain@nyct.net> wrote in message news:<87llpdo337.fsf@nyct.net>...
>> > heliosc@mindspring.com (Rayiner Hashem) writes:
>> >
>> > > Although, keyword arguments don't strike me as very prefix-y. "key:
>> > > value" definately seems like infix syntax to me.
>> >
>> > It's :key value, tho.
>> You are, of course, correct. But the significance ":" still strikes me
>> as adding syntax. Kinda like &rest and #.
":" isn't any additional syntax, as Thomas points out. It has no meaning
in the context of the data structure that is being built for the
arglist. In fact, it is prefix syntax because the description comes
before the value. It's not "value (key)", which would be a reasonable
syntax with an appropriate usage (or lack thereof) of parens elsewhere.
The truth is that this has nothing to do with prefix or infix at the
level of the language; it has to do with namespacing. &rest is there
because you need to do SOMETHING to indicate that the next variable will
be bound to the remainder of the arglist. Why not have a uniform look to
the symbols that are used as markers in the lambda-lists so that it's
easier for humans to spot them? # is there because there are all kinds
of funky data types you might want to enter as a literal using special
formatting conventions.
The character-level syntax is really a different thing than what we're
talking about here, and this is what the OP doesn't get. You don't need
to change the low-level parser in order to add a new operator to the
language, because precedence and associativity aren't an issue.
> Not anymore than is already present for reading symbols. Nowhere does
> Common Lisp require that keyword argument markers be keyword SYMBOLS.
> You are allowed to use any symbols at all for the keywords.
>
> Now, most programmers tend to use keywords as the markers for keyword
> arguments, and that is the default, but it isn't mandated. There are,
> in fact, some advocates of NOT using keywords.
I think this is mostly in the case of initargs, as you could have
multiple superclasses with the same symbol-name for their slots, but
different packages. If the initargs are the same symbol, then you get a
strange partial namespace conflict.
-- Rahul Jain rjain@nyct.net Professional Software Developer, Amateur Quantum Mechanicist
- Next message: Rahul Jain: "Re: [OT] Re: Linux & BSD history"
- Previous message: Rahul Jain: "Re: Lisp at sexp's length"
- In reply to: Thomas A. Russ: "Re: Lisp at sexp's length"
- Next in thread: Eric Merritt: "Re: Lisp at sexp's length"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|