unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Richard Shann <richard@rshann.plus.com>
To: Marko Rauhamaa <marko@pacujo.net>,
	Panicz Maciej Godek <godek.maciek@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Syntactic significance of dot
Date: Tue, 23 Sep 2014 09:49:44 +0100	[thread overview]
Message-ID: <1411462184.3458.154.camel@DebianBox.loc> (raw)
In-Reply-To: <87sijj1iau.fsf@elektro.pacujo.net>

On Tue, 2014-09-23 at 00:01 +0300, Marko Rauhamaa wrote:
> Richard Shann <richard@rshann.plus.com>:
> 
> > I've come across some (working) scheme code whose meaning I can't
> > unravel. The problem is there is a "." character whose significance
> > eludes me. The guile reference doesn't index this character, and I can
> > only find references to it in writing literal pairs.
> 
> That's what it's for and nothing else, including in your example.
> 
>     (a b . c)
> 
> is equivalent to
> 
>     (a . (b . c))

Thank you for the replies to my email. I see that in the case I cited it
is being used to construct a list - the last element is a list.

This looks like a major omission in the guile documentation, under pairs
http://www.gnu.org/software/guile/manual/html_node/Pairs.html#Pairs
it says:

"Pairs can literally get entered in source code or at the REPL, in the
so-called dotted list syntax. This syntax consists of an opening
parentheses, the first element of the pair, a dot, the second element
and a closing parentheses."

and under lists
http://www.gnu.org/software/guile/manual/html_node/List-Syntax.html#List-Syntax

"The syntax for lists is an opening parentheses, then all the elements
of the list (separated by whitespace) and finally a closing
parentheses."

but the syntax for a list can also be 
...then elements of the list (separated by whitespace) a dot followed by
a list followed by a closing parenthesis"

- this doesn't quite describe using this syntax for improper lists
though.

Anyway, I am thoroughly educated on this topic now :) Thank you both
very much.

Richard









      reply	other threads:[~2014-09-23  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 18:12 Syntactic significance of dot Richard Shann
2014-09-22 18:32 ` Panicz Maciej Godek
2014-09-22 18:38   ` Panicz Maciej Godek
2014-09-22 18:43   ` Panicz Maciej Godek
2014-09-22 21:01 ` Marko Rauhamaa
2014-09-23  8:49   ` Richard Shann [this message]

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/guile/

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

  git send-email \
    --in-reply-to=1411462184.3458.154.camel@DebianBox.loc \
    --to=richard@rshann.plus.com \
    --cc=godek.maciek@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=marko@pacujo.net \
    /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).