guile-devel
[Top][All Lists]
Advanced

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

Re: (. wtf?)


From: Dmitry Alexandrov
Subject: Re: (. wtf?)
Date: Sun, 07 May 2023 21:06:21 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

On Fri, 05 May 2023 16:35 Ludovic Courtès <civodul@toot.aquilenet.fr> wrote:
> (call-with-input-string "(. wtf?)" read)
>
> ⇒ wtf?
>
> #Guile #Scheme

Hey!^W  Sorry...

Dear Guile developer,

your tweet made me deeply concerned.  Is it a sign that this behaviour is going 
to be ‘fixed’ eventually?

Besides actually being (imho) the only right thing to do: explanation below 
aside, just compare:
#+begin_src scheme
(define (fu bar) ...)
(λ (bar) ...)
(define (fu . quux) ...)
(λ (. quux) ...)
#+end_src

it is required for compatibility with elisp; where itʼs not only observed 
de-facto:
#+begin_src elisp
'(. foo)
;; ⇒ foo
#+end_src

but explicitly documented in (info "(elisp) Dotted Pair Notation") as well:
#+begin_quote
   As a somewhat peculiar side effect of ‘(a b . c)’ and ‘(a . (b . c))’
being equivalent, for consistency this means that if you replace ‘b’
here with the empty sequence, then it follows that ‘(a . c)’ and ‘(a . (
. c))’ are equivalent, too.  This also means that ‘( . c)’ is equivalent
to ‘c’, but this is seldom used.
#+end_quote





reply via email to

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