Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Always draw your curves, then plot your reading.


devel / comp.lang.lisp / Re: NIL cons cell

SubjectAuthor
* NIL cons cellDaniel Cerqueira
+* Re: NIL cons cellStefan Ram
|`* Re: NIL cons cellDaniel Cerqueira
| +* Re: NIL cons cellLars Brinkhoff
| |`* Re: NIL cons cellStefan Ram
| | `- Re: NIL cons cellStefan Ram
| +- Re: NIL cons cellRaymond Wiker
| `- Re: NIL cons cellKaz Kylheku
+* Re: NIL cons cellKaz Kylheku
|`* Re: NIL cons cellMadhu
| `* Re: NIL cons cellDaniel Cerqueira
|  `* Re: NIL cons cellBen Bacarisse
|   `- Re: NIL cons cellDaniel Cerqueira
+- Re: NIL cons cellJens Kallup
`- Re: NIL cons cellKaz Kylheku

1
NIL cons cell

<8734uj0x2m.fsf@brilhante.top>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!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: dan.list@brilhante.top (Daniel Cerqueira)
Newsgroups: comp.lang.lisp
Subject: NIL cons cell
Date: Sat, 27 Jan 2024 12:39:45 +0000
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <8734uj0x2m.fsf@brilhante.top>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="8713cb2c3dbe4619d4373f7fca0f735f";
logging-data="3560894"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZaPuI1JOmhkShH2C8wZvOR5+Mt3+NzzI="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:gBow2c/CL1p6UF9Vn9o9xM50tGQ=
sha1:sMFqjnmit+GmnicuXa+hQamElYk=
 by: Daniel Cerqueira - Sat, 27 Jan 2024 12:39 UTC

I am wondering about the cons cell representation of NIL.
For example, with '(1 2) , is the representation like this:

+---.---+ +---.---+ +---.---+
| 1 | .---->| 2 | .---->| | |
+---.---+ +---.---+ +---.---+
?

Notice on the representation of NIL. Is this always an empty cons cell?
Is it safe to say that all proper lists end with an empty cons cell?

Re: NIL cons cell

<NIL-20240127140420@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.bbs.nz!news.mb-net.net!open-news-network.org!news.mind.de!bolzen.all.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Date: 27 Jan 2024 13:04:38 GMT
Organization: Stefan Ram
Lines: 11
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <NIL-20240127140420@ram.dialup.fu-berlin.de>
References: <8734uj0x2m.fsf@brilhante.top>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 1DAyuRIAMnTN7/TsTgLEAwSMaKlRkrwYhrpKBuw2gAzpi5
Cancel-Lock: sha1:9vTiRHa9m42RBw3y20Y0lk6Vea8= sha256:jEc/RjRx876oO73e00rOi/FBcrbDV3VFz2pK6C8Ez0g=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Sat, 27 Jan 2024 13:04 UTC

Daniel Cerqueira <dan.list@brilhante.top> writes:
>Notice on the representation of NIL. Is this always an empty cons cell?

NIL is a special value that is /not/ the same as `(NIL . NIL),
which is a dotted pair ("cell") with its CAR and CDR being NIL.

The notation `() for NIL does /not/ mean that NIL is represented
by an empty cons cell.

`(1 2) is `( 1 . ( 2 . NIL )).

Re: NIL cons cell

<87y1cazz9d.fsf@brilhante.top>

  copy mid

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

  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: dan.list@brilhante.top (Daniel Cerqueira)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Date: Sat, 27 Jan 2024 13:23:10 +0000
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <87y1cazz9d.fsf@brilhante.top>
References: <8734uj0x2m.fsf@brilhante.top>
<NIL-20240127140420@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="8713cb2c3dbe4619d4373f7fca0f735f";
logging-data="3572102"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+OMNHo/9I5IKWS0KsWB1URgLU5/TNY5PI="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:40gs8KenC/pBraRKVG842UWfp94=
sha1:M64o85lvRzS4vQAc4NZcJYD2loM=
 by: Daniel Cerqueira - Sat, 27 Jan 2024 13:23 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:

> Daniel Cerqueira <dan.list@brilhante.top> writes:
>>Notice on the representation of NIL. Is this always an empty cons cell?
>
> NIL is a special value that is /not/ the same as `(NIL . NIL),
> which is a dotted pair ("cell") with its CAR and CDR being NIL.

You are defining NIL with NIL, which is a poor, and confusing teaching.

> The notation `() for NIL does /not/ mean that NIL is represented
> by an empty cons cell.
>
> `(1 2) is `( 1 . ( 2 . NIL )).

Then, if NIL is not represented by an empty cons cell, how is NIL
represented?

Re: NIL cons cell

<7w7cjuq2mk.fsf@junk.nocrew.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.samoylyk.net!newsfeed.pionier.net.pl!fu-berlin.de!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
From: lars.spam@nocrew.org (Lars Brinkhoff)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Organization: nocrew
References: <8734uj0x2m.fsf@brilhante.top>
<NIL-20240127140420@ram.dialup.fu-berlin.de>
<87y1cazz9d.fsf@brilhante.top>
Date: Sat, 27 Jan 2024 14:20:35 +0000
Message-ID: <7w7cjuq2mk.fsf@junk.nocrew.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
Cancel-Lock: sha1:dhbI0W+y2BRxizo+AXFFbxueAp4=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 6
NNTP-Posting-Host: 5fdd18f2.news.sunsite.dk
X-Trace: 1706365235 news.sunsite.dk 707 lars@junk.nocrew.org/51.15.56.219:43060
X-Complaints-To: staff@sunsite.dk
 by: Lars Brinkhoff - Sat, 27 Jan 2024 14:20 UTC

Daniel Cerqueira wrote:
> Then, if NIL is not represented by an empty cons cell, how is NIL
> represented?

NIL is a symbol (and also an (empty) list). Its internal representation
is not specified by the standard.

Re: NIL cons cell

<m28r4ayhjt.fsf@MacBook-Pro-2.home>

  copy mid

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

  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: rwiker@gmail.com (Raymond Wiker)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Date: Sat, 27 Jan 2024 15:31:02 +0100
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <m28r4ayhjt.fsf@MacBook-Pro-2.home>
References: <8734uj0x2m.fsf@brilhante.top>
<NIL-20240127140420@ram.dialup.fu-berlin.de>
<87y1cazz9d.fsf@brilhante.top>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1264cb20a338d3b2065d8fe8b14914b7";
logging-data="3594049"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+r6NOPrlCjZs7Yb4MK1xTl"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:qYwDOGOlvaa6s+jMAgV8g7DlLu0=
sha1:QP7ZeKZtqENcxXRXKkfi+kbchpA=
 by: Raymond Wiker - Sat, 27 Jan 2024 14:31 UTC

Daniel Cerqueira <dan.list@brilhante.top> writes:

> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>
>> Daniel Cerqueira <dan.list@brilhante.top> writes:
>>>Notice on the representation of NIL. Is this always an empty cons cell?
>>
>> NIL is a special value that is /not/ the same as `(NIL . NIL),
>> which is a dotted pair ("cell") with its CAR and CDR being NIL.
>
> You are defining NIL with NIL, which is a poor, and confusing teaching.
>
>> The notation `() for NIL does /not/ mean that NIL is represented
>> by an empty cons cell.
>>
>> `(1 2) is `( 1 . ( 2 . NIL )).
>
> Then, if NIL is not represented by an empty cons cell, how is NIL
> represented?

nil is a predefined symbol which has itself as its value. The same goes
for t, as well as any symbol in the keyword package.

So,

(eq nil 'nil) => t
(eq t 't) => t

(eq (cons nil nil) nil) => nil

Note also:
(eq (cons nil nil) (cons nil nil)) => nil

So, in general, a cons cell with nil as car and cdr is not identical to
any other cons cell with car=cdr=nil.

A possibly useful comparison might be with NULL or null in lesser
programming languages, and None in even lesserer languages.

Re: NIL cons cell

<NIL-20240127154615@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Date: 27 Jan 2024 14:49:19 GMT
Organization: Stefan Ram
Lines: 22
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <NIL-20240127154615@ram.dialup.fu-berlin.de>
References: <8734uj0x2m.fsf@brilhante.top> <NIL-20240127140420@ram.dialup.fu-berlin.de> <87y1cazz9d.fsf@brilhante.top> <7w7cjuq2mk.fsf@junk.nocrew.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 3ojyyaKfpfBYuFPncjgjxg+DF4yBfAAr63ss2CSjxIUslW
Cancel-Lock: sha1:bytCnVFlzKrSV1wvbaQQYFaaQR4= sha256:RXqyiPH8PaATJmF1mVA9/fPcsdqi7kr8s7Sm+ik6NCw=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Sat, 27 Jan 2024 14:49 UTC

Lars Brinkhoff <lars.spam@nocrew.org> writes:
>NIL is a symbol (and also an (empty) list). Its internal representation
>is not specified by the standard.

A symbol is an entity of the source-code model.

A list is an entity of the runtime model.

So, NIL "is" a symbol and a list (and also an atom), but on two
different layers: In the source code it's a symbol, and the value of
that symbol when it is being evaluated at runtime is the empty list.

Models always contain entities which are not defined by
being a kind of a more fundamental entity, because it is
not possible to define every entity in that manner. But such
entities are defined by their relations to other entities.

Not defining the representation of entities gives Lisp the
flexibility to be implemented in various ways on various machines.
But it takes some time to get used to this kind of abstract thinking
where abstract models replace specific internal representations.

Re: NIL cons cell

<name-20240127155307@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!rocksolid2!news.neodome.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Date: 27 Jan 2024 14:53:35 GMT
Organization: Stefan Ram
Lines: 6
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <name-20240127155307@ram.dialup.fu-berlin.de>
References: <8734uj0x2m.fsf@brilhante.top> <NIL-20240127140420@ram.dialup.fu-berlin.de> <87y1cazz9d.fsf@brilhante.top> <7w7cjuq2mk.fsf@junk.nocrew.org> <NIL-20240127154615@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de u+EdjQ439sKnxLAonXqwyArG4Y4FD82kQAkIsVYaKGDU1Z
Cancel-Lock: sha1:5gwfWSdiNiKKvSHQjUEaPbaR6tY= sha256:ylPgzydBMKyLQoT3UXoPRq4smJVF1ymR4fmPp2+HRSM=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Sat, 27 Jan 2024 14:53 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>A symbol is an entity of the source-code model.

Well, the /name/ of the symbol is the actual entity of the
source-code model.

Re: NIL cons cell

<20240127090616.827@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!paganini.bofh.team!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: NIL cons cell
Date: Sat, 27 Jan 2024 17:09:26 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <20240127090616.827@kylheku.com>
References: <8734uj0x2m.fsf@brilhante.top>
Injection-Date: Sat, 27 Jan 2024 17:09:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="85b954c92e20c07bbf64fab99e256847";
logging-data="3643595"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ztOBpBdalvkIfh7ooByCUJfLIJ7e6+Os="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:ya2/D0zVPe1+j3WF5288y+nN9dw=
 by: Kaz Kylheku - Sat, 27 Jan 2024 17:09 UTC

On 2024-01-27, Daniel Cerqueira <dan.list@brilhante.top> wrote:
> I am wondering about the cons cell representation of NIL.

Nil isn't formally a cons cell.

> For example, with '(1 2) , is the representation like this:
>
> +---.---+ +---.---+ +---.---+
> | 1 | .---->| 2 | .---->| | |
> +---.---+ +---.---+ +---.---+

A CL implementation can represent nil in any way it wants as long as it
is consistent with the language. It is possible for nil to *internally*
be a cons cell object (provided it's only one global object).

> Notice on the representation of NIL. Is this always an empty cons cell?

In some impelmentations, it's not a heap allocated object at all, but
a special unboxed value.

Formally, nil is of symbol type. (symbolp nil) has to yield true,
and everything has to work: (symbol-name nil), (symbol-package nil).

In a system where nil is a special bit pattern, and not a pointer
to a symbol object, all those functions have to check for nil as
a special case.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: NIL cons cell

<20240127091002.514@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.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: Re: NIL cons cell
Date: Sat, 27 Jan 2024 17:11:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <20240127091002.514@kylheku.com>
References: <8734uj0x2m.fsf@brilhante.top>
<NIL-20240127140420@ram.dialup.fu-berlin.de> <87y1cazz9d.fsf@brilhante.top>
Injection-Date: Sat, 27 Jan 2024 17:11:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="85b954c92e20c07bbf64fab99e256847";
logging-data="3643595"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18SvV3HGIYkh74j3CK90IfUJwBBjmaJrgc="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:i5mHjWGiNWaQhQ2lFyz9yQwq9f4=
 by: Kaz Kylheku - Sat, 27 Jan 2024 17:11 UTC

On 2024-01-27, Daniel Cerqueira <dan.list@brilhante.top> wrote:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>
>> Daniel Cerqueira <dan.list@brilhante.top> writes:
>>>Notice on the representation of NIL. Is this always an empty cons cell?
>>
>> NIL is a special value that is /not/ the same as `(NIL . NIL),
>> which is a dotted pair ("cell") with its CAR and CDR being NIL.
>
> You are defining NIL with NIL, which is a poor, and confusing teaching.

Nonetheless, it *could* work that way. NIL could be internally
represented as a cons cell, whose CAR and CDR are NIL (i.e. that
cell it points to itself).

If it is done correctly, the application cannot tell.

I've not heard of that implementation strategy.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: NIL cons cell

<l1l2tqF4o1gU1@mid.individual.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: paule32.jk@gmail.com (Jens Kallup)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Date: Sat, 27 Jan 2024 20:12:59 +0100
Organization: kallup non-profit
Lines: 47
Message-ID: <l1l2tqF4o1gU1@mid.individual.net>
References: <8734uj0x2m.fsf@brilhante.top>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 52Nzsqs81F000rngCXsl6gvOgLDniuQnYO7qoaQerKpELF8uXx
Cancel-Lock: sha1:ct/cOgmLn2S+ClpDQeLAWEy6Pac= sha256:Coxbc0Xo+NdamYjVGChHjfAdtRUEQ+fIROTDAQuD7rs=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <8734uj0x2m.fsf@brilhante.top>
X-Antivirus: Avast (VPS 240127-4, 27.1.2024), Outbound message
X-Antivirus-Status: Clean
 by: Jens Kallup - Sat, 27 Jan 2024 19:12 UTC

Am 2024-01-27 um 13:39 schrieb Daniel Cerqueira:
> Notice on the representation of NIL. Is this always an empty cons cell?

no.

because, you have a Chain, in LISP, it is a LIST.
You can push Integer Numbers like you want on the "given" LIST.

Firstly, you have to understand, that what you do in LISP have
a left Hand side, and a right Hand side.

( 1 2 ) is a List
(+ 1 2 ) is a Operation - addition, because the Operator at the
second character is a Function.
This Function add the Term aka RPN (reverse polish notation).
The rpn is built stright forward:
1. push first number on the stack, here: 2
2. push second number on the stack, here: 1
3. push operator on the stack, here: +
As Result, the value is 3.

Internaly, you have this representation of ( 1 2 )

1. The value: 1 - is the Chain Part, beginning with Index: 0
2. A internal Pointer to the next Chain Part (the nex one is: 2) will
be "point" to the Memory Data in the Computer System, by LISÜ self.
So the first form has the following pseudo: ( 1 ptr-to )

3. The new LIST have: ( ptr-from 2 )

4. When you push a new value to the LIST, you have the Form:
( 1 ptr-to )
-->
( ptr-from 2 )
-->
( ptr-from 3 )

5. The User/Programmers-View is: ( 1 2 3 )
There, you have a set of the power of three Elements.
But you may be can use the Informations that I have give you (above),
to thinking on, that's are sixx Elements (the Pointers).

--
Diese E-Mail wurde von Avast-Antivirussoftware auf Viren geprüft.
www.avast.com

Re: NIL cons cell

<20240127122059.207@kylheku.com>

  copy mid

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

  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: Re: NIL cons cell
Date: Sat, 27 Jan 2024 20:25:09 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <20240127122059.207@kylheku.com>
References: <8734uj0x2m.fsf@brilhante.top>
Injection-Date: Sat, 27 Jan 2024 20:25:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="85b954c92e20c07bbf64fab99e256847";
logging-data="3710122"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eJsGSxlZH0v6w2adJlvUlSHw+Kk2FPvA="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:5OrOUPUJELPyrGYnqM7ouxfwg2o=
 by: Kaz Kylheku - Sat, 27 Jan 2024 20:25 UTC

On 2024-01-27, Daniel Cerqueira <dan.list@brilhante.top> wrote:
> I am wondering about the cons cell representation of NIL.
> For example, with '(1 2) , is the representation like this:
>
> +---.---+ +---.---+ +---.---+
> | 1 | .---->| 2 | .---->| | |
> +---.---+ +---.---+ +---.---+
> ?
>
> Notice on the representation of NIL. Is this always an empty cons cell?
> Is it safe to say that all proper lists end with an empty cons cell?

It is safe to say that all proper lists have an empty proper list
as their suffix! That empty list is nil.

What is the suffix of (a)? It is () / NIL, which you can obtain
using (cdr '(a)) or (rest '(a)).

An empty list isn't a cons cell in Common Lisp and similar
dialects; it is the symbol NIL.

Note that (consp nil) is required to be false; i.e. it must
return nil. Even if the implementation of NIL is a cons cell
internally, that object must not report as a cons cell.

(typeof nil) -> NULL

(consp nil) -> NIL

(atom nil) -> T

(symbolp nil) -> T

(symbol-package nil) -> #<package COMMON-LISP>

(The #<package COMMON-LISP> will look different in your implementation;
The #< characters introduce an implementation-specific notation
that is not machine-readable.)

NIL is defined by properties. Whatever kind of object it is, it
has to satisfy the properties.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: NIL cons cell

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

  copy mid

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

  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: NIL cons cell
Date: Sun, 28 Jan 2024 06:59:16 +0530
Organization: Motzarella
Lines: 38
Message-ID: <m334uiutxv.fsf@leonis4.robolove.meer.net>
References: <8734uj0x2m.fsf@brilhante.top> <20240127090616.827@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="9ec4b62ce975a06b11180657cad29f45";
logging-data="3797374"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Q00Ge0bA9NL3tIukitvwNC+ylEmGVVSE="
Cancel-Lock: sha1:JeHUxoCU9oGwnmyG8ui15fHmzpQ=
sha1:Ig6aagJ4+t3CwDgulJPUtpbD2Ug=
 by: Madhu - Sun, 28 Jan 2024 01:29 UTC

* Kaz Kylheku <20240127090616.827@kylheku.com> :
Wrote on Sat, 27 Jan 2024 17:09:26 -0000 (UTC):

> On 2024-01-27, Daniel Cerqueira <dan.list@brilhante.top> wrote:
>> I am wondering about the cons cell representation of NIL.
>
> Nil isn't formally a cons cell.
>
>> For example, with '(1 2) , is the representation like this:
>>
>> +---.---+ +---.---+ +---.---+
>> | 1 | .---->| 2 | .---->| | |
>> +---.---+ +---.---+ +---.---+
>
> A CL implementation can represent nil in any way it wants as long as it
> is consistent with the language. It is possible for nil to *internally*
> be a cons cell object (provided it's only one global object).

(consp nil) has to be true. NIL cannot be of type CONS.

It makes no sense to say NIL can be implemented using a "cons cell object"

>> Notice on the representation of NIL. Is this always an empty cons cell?

No NIL is not a cons cell.

> In some impelmentations, it's not a heap allocated object at all, but
> a special unboxed value.
>
> Formally, nil is of symbol type. (symbolp nil) has to yield true,
> and everything has to work: (symbol-name nil), (symbol-package nil).
>
> In a system where nil is a special bit pattern, and not a pointer
> to a symbol object, all those functions have to check for nil as
> a special case.

Re: NIL cons cell

<87plxlzkcw.fsf@brilhante.top>

  copy mid

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

  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: dan.list@brilhante.top (Daniel Cerqueira)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Date: Sun, 28 Jan 2024 12:57:19 +0000
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <87plxlzkcw.fsf@brilhante.top>
References: <8734uj0x2m.fsf@brilhante.top> <20240127090616.827@kylheku.com>
<m334uiutxv.fsf@leonis4.robolove.meer.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a0083af4df72414a85bf331cfed5b1c0";
logging-data="4131385"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lz3+T4gBcp/1ciILGgtZt1ynIjjT/ep8="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:qxEVO9FFjFMoPhw2zU9BbgMxKfw=
sha1:u8NTcd0QBjvr9/ik/pz5WLgeM78=
 by: Daniel Cerqueira - Sun, 28 Jan 2024 12:57 UTC

Madhu <enometh@meer.net> writes:

> * Kaz Kylheku <20240127090616.827@kylheku.com> :
> Wrote on Sat, 27 Jan 2024 17:09:26 -0000 (UTC):
>
>> On 2024-01-27, Daniel Cerqueira <dan.list@brilhante.top> wrote:
>>> I am wondering about the cons cell representation of NIL.
>>
>> Nil isn't formally a cons cell.
>>
>>> For example, with '(1 2) , is the representation like this:
>>>
>>> +---.---+ +---.---+ +---.---+
>>> | 1 | .---->| 2 | .---->| | |
>>> +---.---+ +---.---+ +---.---+
>>
>> A CL implementation can represent nil in any way it wants as long as it
>> is consistent with the language. It is possible for nil to *internally*
>> be a cons cell object (provided it's only one global object).
>
>
> (consp nil) has to be true. NIL cannot be of type CONS.
>
> It makes no sense to say NIL can be implemented using a "cons cell object"

Thanks Madhu. That simple explanation makes perfect sense. Didn't
thought of that. ;-)

Re: NIL cons cell

<87a5oos2kb.fsf@bsb.me.uk>

  copy mid

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

  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: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Date: Mon, 29 Jan 2024 13:15:48 +0000
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <87a5oos2kb.fsf@bsb.me.uk>
References: <8734uj0x2m.fsf@brilhante.top> <20240127090616.827@kylheku.com>
<m334uiutxv.fsf@leonis4.robolove.meer.net>
<87plxlzkcw.fsf@brilhante.top>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="51e5664269f6a15e50c792b6e5235b5f";
logging-data="504100"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PqfpAZxcfSuerc2cFl13s+eC+rihHUcU="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:IYLukVtBwQdlWx/caHdH2NSGpXg=
sha1:r9z9Dwq3ddzMbGYK3yQzielCwk0=
X-BSB-Auth: 1.a64020dc08330f8ae40e.20240129131548GMT.87a5oos2kb.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 29 Jan 2024 13:15 UTC

Daniel Cerqueira <dan.list@brilhante.top> writes:

> Madhu <enometh@meer.net> writes:
>
>> * Kaz Kylheku <20240127090616.827@kylheku.com> :
>> Wrote on Sat, 27 Jan 2024 17:09:26 -0000 (UTC):
>>
>>> On 2024-01-27, Daniel Cerqueira <dan.list@brilhante.top> wrote:
>>>> I am wondering about the cons cell representation of NIL.
>>>
>>> Nil isn't formally a cons cell.
>>>
>>>> For example, with '(1 2) , is the representation like this:
>>>>
>>>> +---.---+ +---.---+ +---.---+
>>>> | 1 | .---->| 2 | .---->| | |
>>>> +---.---+ +---.---+ +---.---+
>>>
>>> A CL implementation can represent nil in any way it wants as long as it
>>> is consistent with the language. It is possible for nil to *internally*
>>> be a cons cell object (provided it's only one global object).
>>
>>
>> (consp nil) has to be true. NIL cannot be of type CONS.

I think you meant to write "NIL" (or maybe "not true").

>> It makes no sense to say NIL can be implemented using a "cons cell object"
>
> Thanks Madhu. That simple explanation makes perfect sense. Didn't
> thought of that. ;-)

Simple but not entirely accurate! Kaz said that the implementation can
use any representation it wants *internally* provided it is consistent
with the language. Since the implementation also defines consp (and
atom, etc.), it can return NIL when passed that internal representation
which can indeed be a cons cell.

I've seen it done, though not in a Common Lisp implementation.

--
Ben.

Re: NIL cons cell

<87zfwnyig7.fsf@brilhante.top>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dan.list@brilhante.top (Daniel Cerqueira)
Newsgroups: comp.lang.lisp
Subject: Re: NIL cons cell
Date: Mon, 29 Jan 2024 20:48:24 +0000
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <87zfwnyig7.fsf@brilhante.top>
References: <8734uj0x2m.fsf@brilhante.top> <20240127090616.827@kylheku.com>
<m334uiutxv.fsf@leonis4.robolove.meer.net>
<87plxlzkcw.fsf@brilhante.top> <87a5oos2kb.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="d5415963c2ec006e5263d6297b5978b7";
logging-data="659466"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CHu8ZufsZDcttx6g7PrNXnm62pNJ0Qak="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:qdco2KF867SCBGzXjn9Mvt6kLt4=
sha1:sbs206g4cdUltm8qLyVqYjxDioc=
 by: Daniel Cerqueira - Mon, 29 Jan 2024 20:48 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Daniel Cerqueira <dan.list@brilhante.top> writes:
>
>> Madhu <enometh@meer.net> writes:
>>
>>> * Kaz Kylheku <20240127090616.827@kylheku.com> :
>>> Wrote on Sat, 27 Jan 2024 17:09:26 -0000 (UTC):
>>>
>>>> On 2024-01-27, Daniel Cerqueira <dan.list@brilhante.top> wrote:
>>>>> I am wondering about the cons cell representation of NIL.
>>>>
>>>> Nil isn't formally a cons cell.
>>>>
>>>>> For example, with '(1 2) , is the representation like this:
>>>>>
>>>>> +---.---+ +---.---+ +---.---+
>>>>> | 1 | .---->| 2 | .---->| | |
>>>>> +---.---+ +---.---+ +---.---+
>>>>
>>>> A CL implementation can represent nil in any way it wants as long as it
>>>> is consistent with the language. It is possible for nil to *internally*
>>>> be a cons cell object (provided it's only one global object).
>>>
>>>
>>> (consp nil) has to be true. NIL cannot be of type CONS.
>
> I think you meant to write "NIL" (or maybe "not true").
>
>>> It makes no sense to say NIL can be implemented using a "cons cell object"
>>
>> Thanks Madhu. That simple explanation makes perfect sense. Didn't
>> thought of that. ;-)
>
> Simple but not entirely accurate! Kaz said that the implementation can
> use any representation it wants *internally* provided it is consistent
> with the language. Since the implementation also defines consp (and
> atom, etc.), it can return NIL when passed that internal representation
> which can indeed be a cons cell.
>
> I've seen it done, though not in a Common Lisp implementation.

Ok, thanks Ben.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor