bug#41353: (thunk? (const 1))

2020-05-27 Thread Ludovic Courtès
Hi,

David Kastrup  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#41353: (thunk? (const 1))

2020-05-17 Thread lloda



> On 17 May 2020, at 16:46, Jan Synacek  wrote:
> 
> On Sun, May 17, 2020 at 4:09 PM David Kastrup  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.






bug#41353: (thunk? (const 1))

2020-05-17 Thread Jan Synacek
On Sun, May 17, 2020 at 4:09 PM David Kastrup  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.






bug#41353: (thunk? (const 1))

2020-05-17 Thread David Kastrup


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