unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Re: (. wtf?)
       [not found] <110317045333325207.civodul@toot.aquilenet.fr>
@ 2023-05-07 18:06 ` Dmitry Alexandrov
  2023-05-07 19:44   ` Dr. Arne Babenhauserheide
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dmitry Alexandrov @ 2023-05-07 18:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-devel

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (. wtf?)
  2023-05-07 18:06 ` (. wtf?) Dmitry Alexandrov
@ 2023-05-07 19:44   ` Dr. Arne Babenhauserheide
  2023-05-08  4:32   ` tomas
  2023-05-10 16:25   ` Ludovic Courtès
  2 siblings, 0 replies; 9+ messages in thread
From: Dr. Arne Babenhauserheide @ 2023-05-07 19:44 UTC (permalink / raw)
  To: Dmitry Alexandrov; +Cc: Ludovic Courtès, guile-devel

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


Dmitry Alexandrov <dag@gnui.org> writes:

> 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

Also this is what SRFI-119 / wisp generalizes to enable continuing the
argument list in indentation-based Scheme without introducing additional
syntax. In wisp, not only is =(equal? '(. wtf) 'wtf)=, but also

equal?
  ' a b c
  ' : . a b c

(a structure which is a syntax error in regular Scheme, so no ambiguity
is introduced: =(equal? '(a b c) '((. a b c)))= ⇒ missing close paren: b)

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (. wtf?)
  2023-05-07 18:06 ` (. wtf?) Dmitry Alexandrov
  2023-05-07 19:44   ` Dr. Arne Babenhauserheide
@ 2023-05-08  4:32   ` tomas
  2023-05-08  5:31     ` Dr. Arne Babenhauserheide
  2023-05-08 10:53     ` Dmitry Alexandrov
  2023-05-10 16:25   ` Ludovic Courtès
  2 siblings, 2 replies; 9+ messages in thread
From: tomas @ 2023-05-08  4:32 UTC (permalink / raw)
  To: guile-devel

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

On Sun, May 07, 2023 at 09:06:21PM +0300, Dmitry Alexandrov wrote:
> 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

You seem to be somewhat upset, but I don't quite understand what
your gripe is. Is it the (define (...) ...) shorthand function
definition in Guile? Is it Guile's incompatibility with Emacs
Lisp (no wonder: the first is a Scheme, the second a Lisp: they
are related, but pretty different)?

Could you explain a bit better?

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (. wtf?)
  2023-05-08  4:32   ` tomas
@ 2023-05-08  5:31     ` Dr. Arne Babenhauserheide
  2023-05-08  6:50       ` tomas
  2023-05-08 10:45       ` Dmitry Alexandrov
  2023-05-08 10:53     ` Dmitry Alexandrov
  1 sibling, 2 replies; 9+ messages in thread
From: Dr. Arne Babenhauserheide @ 2023-05-08  5:31 UTC (permalink / raw)
  To: tomas; +Cc: guile-devel

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


<tomas@tuxteam.de> writes:

> You seem to be somewhat upset, but I don't quite understand what
> your gripe is.

If I understood it correctly, they interpret the 'wtf? as expressing
"this is a problem that should be changed" and wanted to say
(equal? '(. a) 'a) should stay #true in Guile and consequently
(call-with-input-string "(. wtf?)" read) ⇒ wft? should stay as it is.

The behavior of '(. a) is implementation dependent for Scheme. Some examples:

- guile: 'a
- kawa: 'a
- chez: error
- chicken: error

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (. wtf?)
  2023-05-08  5:31     ` Dr. Arne Babenhauserheide
@ 2023-05-08  6:50       ` tomas
  2023-05-08 10:45       ` Dmitry Alexandrov
  1 sibling, 0 replies; 9+ messages in thread
From: tomas @ 2023-05-08  6:50 UTC (permalink / raw)
  To: Dr. Arne Babenhauserheide; +Cc: guile-devel

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

On Mon, May 08, 2023 at 07:31:11AM +0200, Dr. Arne Babenhauserheide wrote:
> 
> <tomas@tuxteam.de> writes:
> 
> > You seem to be somewhat upset, but I don't quite understand what
> > your gripe is.
> 
> If I understood it correctly, they interpret the 'wtf? as expressing
> "this is a problem that should be changed" and wanted to say
> (equal? '(. a) 'a) should stay #true in Guile and consequently
> (call-with-input-string "(. wtf?)" read) ⇒ wft? should stay as it is.
> 
> The behavior of '(. a) is implementation dependent for Scheme. Some examples:
> 
> - guile: 'a
> - kawa: 'a
> - chez: error
> - chicken: error

Got it, thanks.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (. wtf?)
  2023-05-08  5:31     ` Dr. Arne Babenhauserheide
  2023-05-08  6:50       ` tomas
@ 2023-05-08 10:45       ` Dmitry Alexandrov
  1 sibling, 0 replies; 9+ messages in thread
From: Dmitry Alexandrov @ 2023-05-08 10:45 UTC (permalink / raw)
  To: Dr. Arne Babenhauserheide; +Cc: tomas, guile-devel

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

"Dr. Arne Babenhauserheide" <arne_bab@web.de> wrote:
> If I understood it correctly

Yes, thank you.

> they

Just to clarify: I have no claims to represent anyoneʼs view but my own.

Having said that, the fact, that by writing a reader without keeping this very case in mind, you get _this_ behaviour (as @janneke@todon.nl put it) “for free”, clearly hints who (Guile/Kawa/Mes or Racket/Chez/Chicken) aligns with schemey way of minimizing the amount of rules and exceptions in a language better. ;-)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (. wtf?)
  2023-05-08  4:32   ` tomas
  2023-05-08  5:31     ` Dr. Arne Babenhauserheide
@ 2023-05-08 10:53     ` Dmitry Alexandrov
  2023-05-08 10:58       ` tomas
  1 sibling, 1 reply; 9+ messages in thread
From: Dmitry Alexandrov @ 2023-05-08 10:53 UTC (permalink / raw)
  To: tomas; +Cc: guile-devel

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

<tomas@tuxteam.de> wrote:
>> it is required for compatibility with elisp
>
> Is it Guile's incompatibility with Emacs Lisp

As of now, they are compatible in that regard.

> (no wonder: the first is a Scheme, the second a Lisp: they are related, but pretty different)

Yet, but if I am not mistaken, =scheme= and =elisp= share the bits of reader, that are responsible for the subject.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (. wtf?)
  2023-05-08 10:53     ` Dmitry Alexandrov
@ 2023-05-08 10:58       ` tomas
  0 siblings, 0 replies; 9+ messages in thread
From: tomas @ 2023-05-08 10:58 UTC (permalink / raw)
  To: Dmitry Alexandrov; +Cc: guile-devel

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

On Mon, May 08, 2023 at 01:53:31PM +0300, Dmitry Alexandrov wrote:
> <tomas@tuxteam.de> wrote:
> >> it is required for compatibility with elisp
> >
> > Is it Guile's incompatibility with Emacs Lisp
> 
> As of now, they are compatible in that regard.
> 
> > (no wonder: the first is a Scheme, the second a Lisp: they are related, but pretty different)
> 
> Yet, but if I am not mistaken, =scheme= and =elisp= share the bits of reader, that are responsible for the subject.

Thanks, Arne found the right hint for me :)

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (. wtf?)
  2023-05-07 18:06 ` (. wtf?) Dmitry Alexandrov
  2023-05-07 19:44   ` Dr. Arne Babenhauserheide
  2023-05-08  4:32   ` tomas
@ 2023-05-10 16:25   ` Ludovic Courtès
  2 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2023-05-10 16:25 UTC (permalink / raw)
  To: Dmitry Alexandrov; +Cc: guile-devel

HI,

Dmitry Alexandrov <dag@gnui.org> skribis:

> 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?

I should clarify that it’s definitely a weird corner case, but not
something I’m worried about.

As I mentioned on Mastodon, Guile’s ‘read’ has always worked like that I
suppose; when he rewrite ‘read’ in Scheme, Andy took care to preserve
the exact same behavior, even for weird cases like this one.

We could remove support for it as it doesn’t bring anything, but I don’t
see any pressure to do so.

Ludo’.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-05-10 16:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <110317045333325207.civodul@toot.aquilenet.fr>
2023-05-07 18:06 ` (. wtf?) Dmitry Alexandrov
2023-05-07 19:44   ` Dr. Arne Babenhauserheide
2023-05-08  4:32   ` tomas
2023-05-08  5:31     ` Dr. Arne Babenhauserheide
2023-05-08  6:50       ` tomas
2023-05-08 10:45       ` Dmitry Alexandrov
2023-05-08 10:53     ` Dmitry Alexandrov
2023-05-08 10:58       ` tomas
2023-05-10 16:25   ` Ludovic Courtès

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).