help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cycle Org Shift Select


From: Christopher Dimech
Subject: Re: Cycle Org Shift Select
Date: Tue, 10 Nov 2020 11:17:22 +0100

Many thanks Tomas, have gone though the Elisp Manual yesterday
and I am getting to understand this list Ouroboros thing. :)


> Sent: Tuesday, November 10, 2020 at 9:08 AM
> From: tomas@tuxteam.de
> To: help-gnu-emacs@gnu.org
> Subject: Re: Cycle Org Shift Select
>
> On Mon, Nov 09, 2020 at 11:49:33PM +0100, Christopher Dimech wrote:
> > What is the meaning of the '.' in '#1=(nil t always . #1#)?
>
> This means that the last cdr in that list isn't nil, as "decent,
> normal lists" (aka "proper lists") have, but a reference to something,
> in this case to the list's head (#1#), which you have taken previously,
> in #1=. Making the whole thing an Ouroboros [1].
>
> In box-and-pointer-ish, the list '(nil t always) looks like so
> (WARNING: psychedelic effects guaranteed when using variable-pitch
> fonts. But who does that, anyway?):
>
>   +-----+--+      +--+--+      +--+-----+
>   | nil |  | ---> |  |  | ---> |  | nil |
>   +-----+--+      +--+--+      +--+-----+
>                     |            |
>                     v            v
>                    't          'always
>
> Note how the list ends with a pair whose cdr is nil.
>
> The dot notation allows you to fill both slots of a pair (car
> and cdr), thus putting something other than the "link to next"
> in a cdr, creating an improper list; the reference notation
> (that #...= and #...#) allows you to take a ref at some place
> and use it later. That's what your above monster looks like
> in box-and-pointer:
>
>         +---------------------------------+
>         |                                 |
>         v                                 |
>   +-----+--+      +--+--+      +--+--+    |
>   | nil |  | ---> |  |  | ---> |  |  | ---+
>   +-----+--+      +--+--+      +--+--+
>                     |            |
>                     v            v
>                    't          'always
>
>
> So if you run *that* list along (by doing cdr), you'll run
> in circles, over and over again. That was this device's
> intention, anyway, if I followed along correctly.
>
> Cheers
>
> [1] https://en.wikipedia.org/wiki/Ouroboros
>  - t
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]