Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

System going down in 5 minutes.


devel / comp.lang.lisp / Which CL implementations support ,',@items?

SubjectAuthor
* Which CL implementations support ,',@items?Kaz Kylheku
`* Re: Which CL implementations support ,',@items?Stefan Monnier
 `* Re: Which CL implementations support ,',@items?Kaz Kylheku
  `- Re: Which CL implementations support ,',@items?Madhu

1
Which CL implementations support ,',@items?

<20231203121349.167@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17540&group=comp.lang.lisp#17540

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Which CL implementations support ,',@items?
Date: Sun, 3 Dec 2023 20:18:18 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <20231203121349.167@kylheku.com>
Injection-Date: Sun, 3 Dec 2023 20:18:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="00c813aa325153dd5b9faa29f9af8eb7";
logging-data="3166191"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ux44MXHE/TX43ywFfab6gi4HVE5obmJ0="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:hItllt7Mi6kT7fLXCjD+gz0ritk=
 by: Kaz Kylheku - Sun, 3 Dec 2023 20:18 UTC

In CLISP, in a nested backquote, you can splice items into a quote
using ,',@items.

This ends up working like ,@',items. It's as if the quote distributes
through the splice and the items are individually quoted and spliced.

In other implementations like SBCL and ECL, this just produces
an invalid quote form like (quote 1 2 3 4) which is an error.
Except in the lucky case when there is one item, of course.

Where else other than CLISP does that work?

According to my interpretation of 2.4.6 Backquote, the behavior does
not arise from that expansion model.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: Which CL implementations support ,',@items?

<jwvlea9k36f.fsf-monnier+comp.lang.lisp@gnu.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17541&group=comp.lang.lisp#17541

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: monnier@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.lang.lisp
Subject: Re: Which CL implementations support ,',@items?
Date: Mon, 04 Dec 2023 17:35:22 -0500
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <jwvlea9k36f.fsf-monnier+comp.lang.lisp@gnu.org>
References: <20231203121349.167@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a6cb630e8980065111d748b853cff4e0";
logging-data="3781288"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//QRt4g6TMLhcnJNn4u+myhegZVzmSuQQ="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:0tK+BD44u95tAahrR/pcFiSBoac=
sha1:aPPehRrszGQiG40BIYFPyxYM6PE=
 by: Stefan Monnier - Mon, 4 Dec 2023 22:35 UTC

> In other implementations like SBCL and ECL, this just produces
> an invalid quote form like (quote 1 2 3 4) which is an error.
> Except in the lucky case when there is one item, of course.

Would it make sense to define (quote 1 2 3 4) as behaving like
(values 1 2 3 4)?

Stefan

Re: Which CL implementations support ,',@items?

<20231204193336.389@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17542&group=comp.lang.lisp#17542

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Which CL implementations support ,',@items?
Date: Tue, 5 Dec 2023 03:44:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <20231204193336.389@kylheku.com>
References: <20231203121349.167@kylheku.com>
<jwvlea9k36f.fsf-monnier+comp.lang.lisp@gnu.org>
Injection-Date: Tue, 5 Dec 2023 03:44:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8d4554b91320cd72d02784fb2f2795bb";
logging-data="3981893"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tc07sKZbmT5Uqp2YB3qLN9Ou6wW2jvdw="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:8cJHh0UxgiZehbVfAkjd7Hj+cuE=
 by: Kaz Kylheku - Tue, 5 Dec 2023 03:44 UTC

On 2023-12-04, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> In other implementations like SBCL and ECL, this just produces
>> an invalid quote form like (quote 1 2 3 4) which is an error.
>> Except in the lucky case when there is one item, of course.
>
> Would it make sense to define (quote 1 2 3 4) as behaving like
> (values 1 2 3 4)?

It's certainly more useful than signaling an error.

It's not directly related to the topic I started (which I don't mind)
unless we make ,(values 1 2 3) equivalent to ,@'(1 2 3)
and ,@(list 1 2 3).

Then we could have it that ,(quote 1 2 3) is like ,@(list 1 2 3).

Splicing values would break existing code which relies on
,(values 1 2 3) behaving like ,1 and ,(values) behaving like nil.

In CLISP, though, the multi-argument quote, if it is produced
by a splice, and being unquoted, does distribute, so that
,(quote ,@(list 1 2 3)) becomes, effectively ,1 ,2 ,3.

Without the quote ,,@expr follows a distributive rule in that
expr evaluates to some list of elements e0 e1 e2 ...
and these are individually unquoted in the second round as if
by ,e1 ,e2 ,e3 ...

In CLISP, even if there is a quote between the , and ,@,
the distribution occurs, carrying duplicates of the quote, so that
,(quote ,@expr) turns into, effectively ,'e1 ,'e2 ,'e3 ...

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: Which CL implementations support ,',@items?

<m3jzptb10p.fsf@leonis4.robolove.meer.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17543&group=comp.lang.lisp#17543

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: enometh@meer.net (Madhu)
Newsgroups: comp.lang.lisp
Subject: Re: Which CL implementations support ,',@items?
Date: Tue, 05 Dec 2023 12:15:42 +0530
Organization: Motzarella
Lines: 46
Message-ID: <m3jzptb10p.fsf@leonis4.robolove.meer.net>
References: <20231203121349.167@kylheku.com>
<jwvlea9k36f.fsf-monnier+comp.lang.lisp@gnu.org>
<20231204193336.389@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="fd629e194f55e2b77f6ad376d11daebb";
logging-data="4022592"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183AAvoQQ/LvM6geu86DQxVbMawBQ2feAs="
Cancel-Lock: sha1:B0JnD9mP3EJNAq7vDgHcmmCRk3k=
sha1:vELMcC62Z9IJBCTkQYbPz8zZGp4=
 by: Madhu - Tue, 5 Dec 2023 06:45 UTC

* Kaz Kylheku <20231204193336.389 @kylheku.com> :
Wrote on Tue, 5 Dec 2023 03:44:45 -0000 (UTC):

> On 2023-12-04, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>> In other implementations like SBCL and ECL, this just produces
>>> an invalid quote form like (quote 1 2 3 4) which is an error.
>>> Except in the lucky case when there is one item, of course.

I think lispworks just the above form as a list of 1 element (in the
"spliced contenxt") and avoids an error on the form previously, but
don't quote me on that.

>>
>> Would it make sense to define (quote 1 2 3 4) as behaving like
>> (values 1 2 3 4)?

LW seemed to do just that, when operating in that context (but I haven't
rechecked to be sure)

> It's certainly more useful than signaling an error.
>
> It's not directly related to the topic I started (which I don't mind)
> unless we make ,(values 1 2 3) equivalent to ,@'(1 2 3)
> and ,@(list 1 2 3).
>
> Then we could have it that ,(quote 1 2 3) is like ,@(list 1 2 3).
>
> Splicing values would break existing code which relies on
> ,(values 1 2 3) behaving like ,1 and ,(values) behaving like nil.
>
> In CLISP, though, the multi-argument quote, if it is produced
> by a splice, and being unquoted, does distribute, so that
> ,(quote ,@(list 1 2 3)) becomes, effectively ,1 ,2 ,3.

I think I relied on this "intuitive behaviour" in clisp at some point
and had to unlearn it to be able to use other lisps.

> Without the quote ,,@expr follows a distributive rule in that
> expr evaluates to some list of elements e0 e1 e2 ...
> and these are individually unquoted in the second round as if
> by ,e1 ,e2 ,e3 ...
>
> In CLISP, even if there is a quote between the , and ,@,
> the distribution occurs, carrying duplicates of the quote, so that
> ,(quote ,@expr) turns into, effectively ,'e1 ,'e2 ,'e3 ...

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor