GNU bug report logs - #41353
'thunk?' documentation is misleading

Previous Next

Package: guile;

Reported by: Jan Synacek <jsynacek <at> redhat.com>

Date: Sun, 17 May 2020 10:42:01 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41353 in the body.
You can then email your comments to 41353 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#41353; Package guile. (Sun, 17 May 2020 10:42:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Synacek <jsynacek <at> redhat.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sun, 17 May 2020 10:42:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jan Synacek <jsynacek <at> redhat.com>
To: bug-guile <at> gnu.org
Subject: (const x) is a thunk
Date: Sun, 17 May 2020 12:41:05 +0200
With guile-3.0.2:

scheme@(guile-user)> (thunk? (const 1))
$1 = #t

Since thunk is a procedure that does not accept arguments (section
6.9.7, documentation for 'thunk?'), the result of the above evaluation
should be #f.





Information forwarded to bug-guile <at> gnu.org:
bug#41353; Package guile. (Sun, 17 May 2020 14:09:01 GMT) Full text and rfc822 format available.

Message #8 received at 41353 <at> debbugs.gnu.org (full text, mbox):

From: David Kastrup <dak <at> gnu.org>
To: 41353 <at> debbugs.gnu.org
Subject: (thunk? (const 1))
Date: Sun, 17 May 2020 16:08:50 +0200
I think this is more a matter of the documentation being not quite right:

 -- Scheme Procedure: thunk? obj
 -- C Function: scm_thunk_p (obj)
     Return ‘#t’ if OBJ is a thunk—a procedure that does not accept
     arguments.

"if OBJ can serve as a thunk—a procedure called without arguments."

Note that (thunk? (lambda x x)) also returns #t and that ((const 1))
returns 1.

-- 
David Kastrup




Information forwarded to bug-guile <at> gnu.org:
bug#41353; Package guile. (Sun, 17 May 2020 14:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 41353 <at> debbugs.gnu.org (full text, mbox):

From: Jan Synacek <jsynacek <at> redhat.com>
To: 41353 <at> debbugs.gnu.org
Subject: Re: bug#41353: (thunk? (const 1))
Date: Sun, 17 May 2020 16:46:40 +0200
On Sun, May 17, 2020 at 4:09 PM David Kastrup <dak <at> gnu.org> wrote:
> I think this is more a matter of the documentation being not quite right:
>
>  -- Scheme Procedure: thunk? obj
>  -- C Function: scm_thunk_p (obj)
>      Return ‘#t’ if OBJ is a thunk—a procedure that does not accept
>      arguments.
>
> "if OBJ can serve as a thunk—a procedure called without arguments."
>
> Note that (thunk? (lambda x x)) also returns #t and that ((const 1))
> returns 1.

But both (lambda x ...) and (const whatever) are still a procedure that accepts
an argument, aren't they? My understanding of thunk is (lambda () ...),
because that's a procedure that takes zero arguments.





Information forwarded to bug-guile <at> gnu.org:
bug#41353; Package guile. (Sun, 17 May 2020 15:32:02 GMT) Full text and rfc822 format available.

Message #14 received at 41353 <at> debbugs.gnu.org (full text, mbox):

From: lloda <lloda <at> sarc.name>
To: Jan Synacek <jsynacek <at> redhat.com>
Cc: 41353 <at> debbugs.gnu.org
Subject: Re: bug#41353: (thunk? (const 1))
Date: Sun, 17 May 2020 17:31:22 +0200

> On 17 May 2020, at 16:46, Jan Synacek <jsynacek <at> redhat.com> wrote:
> 
> On Sun, May 17, 2020 at 4:09 PM David Kastrup <dak <at> gnu.org> wrote:
>> I think this is more a matter of the documentation being not quite right:
>> 
>> -- Scheme Procedure: thunk? obj
>> -- C Function: scm_thunk_p (obj)
>>     Return ‘#t’ if OBJ is a thunk—a procedure that does not accept
>>     arguments.
>> 
>> "if OBJ can serve as a thunk—a procedure called without arguments."
>> 
>> Note that (thunk? (lambda x x)) also returns #t and that ((const 1))
>> returns 1.
> 
> But both (lambda x ...) and (const whatever) are still a procedure that accepts
> an argument, aren't they? My understanding of thunk is (lambda () ...),
> because that's a procedure that takes zero arguments.

(lambda x ...) takes any number of arguments, including none.





Changed bug title to ''thunk?' documentation is misleading' from '(const x) is a thunk' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 27 May 2020 20:37:01 GMT) Full text and rfc822 format available.

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 27 May 2020 20:51:01 GMT) Full text and rfc822 format available.

Notification sent to Jan Synacek <jsynacek <at> redhat.com>:
bug acknowledged by developer. (Wed, 27 May 2020 20:51:02 GMT) Full text and rfc822 format available.

Message #21 received at 41353-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: David Kastrup <dak <at> gnu.org>
Cc: 41353-done <at> debbugs.gnu.org
Subject: Re: bug#41353: (thunk? (const 1))
Date: Wed, 27 May 2020 22:50:04 +0200
Hi,

David Kastrup <dak <at> gnu.org> skribis:

> I think this is more a matter of the documentation being not quite right:
>
>  -- Scheme Procedure: thunk? obj
>  -- C Function: scm_thunk_p (obj)
>      Return ‘#t’ if OBJ is a thunk—a procedure that does not accept
>      arguments.
>
> "if OBJ can serve as a thunk—a procedure called without arguments."

Agreed.  Fixed in 9c03e44dcfc118c37d28bb948f4d255c7b755d96.

Thanks,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Jun 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.