unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Cycle Org Shift Select
Date: Tue, 10 Nov 2020 09:08:29 +0100	[thread overview]
Message-ID: <20201110080829.GA11023@tuxteam.de> (raw)
In-Reply-To: <trinity-2ad36cd3-10ca-4453-8974-c80cc868c2a3-1604962173537@3c-app-mailcom-bs07>

[-- Attachment #1: Type: text/plain, Size: 1826 bytes --]

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2020-11-10  8:08 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 15:23 Cycle Org Shift Select Christopher Dimech
2020-11-09 19:12 ` Noam Postavsky
2020-11-09 20:13   ` Michael Heerdegen
2020-11-09 20:26     ` Noam Postavsky
2020-11-09 20:31       ` Michael Heerdegen
2020-11-09 20:37         ` Noam Postavsky
2020-11-09 21:08           ` Michael Heerdegen
2020-11-09 21:19             ` Noam Postavsky
2020-11-09 20:40     ` Christopher Dimech
2020-11-09 20:42       ` Noam Postavsky
2020-11-09 20:52         ` Christopher Dimech
2020-11-09 20:53           ` Noam Postavsky
2020-11-09 21:20             ` Michael Heerdegen
2020-11-09 21:25               ` Noam Postavsky
2020-11-09 21:36                 ` Michael Heerdegen
2020-11-09 21:45             ` Christopher Dimech
2020-11-09 21:49               ` Noam Postavsky
2020-11-09 21:50               ` Michael Heerdegen
2020-11-09 21:59                 ` Christopher Dimech
2020-11-09 22:49       ` Christopher Dimech
2020-11-10  8:08         ` tomas [this message]
2020-11-10 10:17           ` Christopher Dimech
2020-11-10 11:10             ` Michael Heerdegen
2020-11-10 16:37   ` Drew Adams
2020-11-11 17:09     ` Drew Adams
2020-11-09 20:10 ` Michael Heerdegen
2020-11-09 20:35   ` Christopher Dimech
2020-11-09 21:18     ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201110080829.GA11023@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).