On Sat, 10 Mar 2007 21:37:49 +0100, Johan Ur Riise <·····@riise-data.no>
wrote:
>
> Why is there not a backquote function or special form,
> while threre is '... == (quote ...)
There is.. sort. of
(let (x)
`(fun ,x))
means (let (x) (list 'fun x) or (let (x) (list (quote fun) x)) if you will.
So it is kinda the inverse of quote, every variable not superseded by , is
quoted.
But of cource you could also do this explicitly.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
In article <··············@morr.riise-data.net>,
Johan Ur Riise <·····@riise-data.no> wrote:
> Why is there not a backquote function or special form,
> while threre is '... == (quote ...)
To allow implementations flexibility in how they expand backquote.
Quote is so simple that there's no need for this, but backquote is
complex enough that there are a number of different ways a particular
expression could be expanded.
And when CL was being standardized there was already quite a bit of
variation in backquote implementations. Standardizing the expansion
would have required just about every implementation to change, for
little benefit.
--
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Barry Margolin wrote:
> In article <··············@morr.riise-data.net>,
> Johan Ur Riise <·····@riise-data.no> wrote:
> > Why is there not a backquote function or special form,
> > while threre is '... == (quote ...)
>
> To allow implementations flexibility in how they expand backquote.
> Quote is so simple that there's no need for this, but backquote is
> complex enough that there are a number of different ways a particular
> expression could be expanded.
>
> And when CL was being standardized there was already quite a bit of
> variation in backquote implementations. Standardizing the expansion
> would have required just about every implementation to change, for
> little benefit.
Searching for "backquote special operator" showed a lot of arguments
that this probably wasn't the best design, and Scheme may be better in
this regard.
Tayssir
On 11 Mar 2007 13:05:14 -0700, "Tayssir John Gabbour" <············@googlemail.com> said:
| Barry Margolin wrote:
|| In article <··············@morr.riise-data.net>,
|| Johan Ur Riise <·····@riise-data.no> wrote:
|| > Why is there not a backquote function or special form,
|| > while threre is '... == (quote ...)
||
|| To allow implementations flexibility in how they expand backquote.
|| Quote is so simple that there's no need for this, but backquote is
|| complex enough that there are a number of different ways a particular
|| expression could be expanded.
||
|| And when CL was being standardized there was already quite a bit of
|| variation in backquote implementations. Standardizing the expansion
|| would have required just about every implementation to change, for
|| little benefit.
| Searching for "backquote special operator" showed a lot of arguments
| that this probably wasn't the best design, and Scheme may be better in
| this regard.
Still, with regards to the way the original question drew a parallel
between the backquote and the quote reader macros, it is worth noting
that the necessity is at a different level: it is possible to
implement the former without its special operator, albeit imperfectly,
but not the latter, not without changing the language itself in a
significant way. (Perhaps at the cost of losing the "code is data"
property. Cf. the (algorithmic) language of M-expressions, which
does not have (or need) a "quote" special operator.)
---Vassil.
--
Is your code free of side defects?
On Mar 10, 12:37 pm, Johan Ur Riise <····@riise-data.no> wrote:
> Why is there not a backquote function or special form,
> while threre is '... == (quote ...)
Because when Common Lisp was standarized, existing implementations did
not have such a thing, and each one implemented the read macro in its
own way: a situation which persists today.
Therefore, to introduce a BACKQUOTE operator would have meant
inventing this language feature and forcing everyone to implement it.
In the first round of standardizing a widely implemented existing
language, you generally want to codify existing features that are
common to the various implementations, rather than invent new things
that nobody has. There are exceptions to this principle, but backquote
didn't end up one of the exceptions.
"Kaz Kylheku" <········@gmail.com> writes:
> On Mar 10, 12:37 pm, Johan Ur Riise <····@riise-data.no> wrote:
> > Why is there not a backquote function or special form,
> > while threre is '... == (quote ...)
>
> Because when Common Lisp was standarized, existing implementations did
> not have such a thing, and each one implemented the read macro in its
> own way: a situation which persists today.
>
> Therefore, to introduce a BACKQUOTE operator would have meant
> inventing this language feature and forcing everyone to implement it.
>
> In the first round of standardizing a widely implemented existing
> language, you generally want to codify existing features that are
> common to the various implementations, rather than invent new things
> that nobody has. There are exceptions to this principle, but backquote
> didn't end up one of the exceptions.
Thanks everybody, that is good enough for me.
I started creating a backquote macro just for fun,
(producing cones and quotes), but it became to complicated.
Kaz Kylheku <········@gmail.com> wrote:
+---------------
| Johan Ur Riise <····@riise-data.no> wrote:
| > Why is there not a backquote function or special form,
| > while threre is '... == (quote ...)
|
| Because when Common Lisp was standarized, existing implementations did
| not have such a thing, and each one implemented the read macro in its
| own way: a situation which persists today.
|
| Therefore, to introduce a BACKQUOTE operator would have meant
| inventing this language feature and forcing everyone to implement it.
|
| In the first round of standardizing a widely implemented existing
| language, you generally want to codify existing features that are
| common to the various implementations, rather than invent new things
| that nobody has. There are exceptions to this principle, but backquote
| didn't end up one of the exceptions.
+---------------
Unfortunate, IMHO, since IIUIC by the time ANSI CL was gelling
Scheme already *had* standardized a convenient S-expr expansion
for each backquote-related readmacro:
`form ==> (backquote form)
,form ==> (unquote form)
,@form ==> (unquote-splicing form)
Unlike CL, in Scheme BACKQUOTE is *not* implemented in the reader,
which merely expands the readmacros into the corresponding S-expr
expansions. BACKQUOTE is instead [pnormally] evaluated by EVAL,
and is of course a special form that must do a tree-walk of its
FORM argument and "do the right thing" when it encounters a sublist
whose CAR is UNQUOTE or UNQUOTE-SPLICING. There is considerable
experience in the Scheme community with this mapping, including
allowing UNQUOTE or UNQUOTE-SPLICING readmacros to be included
in *other* special forms than just BACKQUOTE. ["Scsh" a.k.a. "The
Scheme Shell" depends upon this, but CL *forbids* it, which is why
transliterating "Scsh" to "CLsh"[1] involves inserting lots of
backticks at inconvenient places.]
-Rob
[1] No, I know of no fully-working "CLsh", only a few gedankenexperiments
and/or.
-----
Rob Warnock <····@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607