unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: David Kastrup <dak@gnu.org>
Cc: guile-devel@gnu.org
Subject: Re: Dotted pair call argument
Date: Tue, 21 Feb 2012 19:41:49 -0500	[thread overview]
Message-ID: <87sji3zoky.fsf@netris.org> (raw)
In-Reply-To: <8762f0cbag.fsf@fencepost.gnu.org> (David Kastrup's message of "Tue, 21 Feb 2012 19:05:11 +0100")

David Kastrup <dak@gnu.org> writes:

>> Scheme has a very useful property which your proposed syntax would
>> destroy: any valid expression can be substituted for any other valid
>> expression, and the result has the same meaning except for the
>> substitution.
>
> guile> (display . (close (current-output-port)))
> #<primitive-procedure close>guile> 
>
> Now try
>
> (define x (close (current-output-port)))
> (display . x)

Admittedly I could have been more clear, but I certainly didn't mean to
imply that anything that _looks_ like a valid expression can be
replaced.  That would be absurd.

What I meant is that any _subexpression_ can be replaced with any other
valid expression, without changing the meaning of the program in any
other way.  Whether something is a subexpression depends on its
_position_ within the larger expression.

In (display close (current-output-port)), even if you write it
confusingly in dotted-tail notation, (close (current-output-port)) is
_not_ a subexpression, because it is not in subexpression position.

The only advantage I see to this proposed syntax is that in some
restricted cases it is more aesthetically pleasing.  I suspect that most
experienced Schemers have at some point wondered why dotted-tail
notation is not allowed in procedure calls.  I certainly have, but upon
further consideration I became convinced that the pitfalls of adopting
such an ambiguous and potentially confusing syntax far outweigh the
advantages.

    Thanks,
      Mark



  reply	other threads:[~2012-02-22  0:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 14:03 Dotted pair call argument David Kastrup
2012-02-21 15:36 ` Mark H Weaver
2012-02-21 15:59   ` David Kastrup
2012-02-21 16:05     ` David Kastrup
2012-02-21 17:23     ` Mark H Weaver
2012-02-21 18:05       ` David Kastrup
2012-02-22  0:41         ` Mark H Weaver [this message]
2012-02-22  9:06           ` David Kastrup
2012-02-21 20:31       ` Neil Jerram

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=87sji3zoky.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=dak@gnu.org \
    --cc=guile-devel@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).