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

Jan Synacek <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <CAPsXM8X0ub1uxS_fuToQtqkgH3_BMi__1v3=hX=Te1m_5R0Myw@mail.gmail.com>
On Sun, May 17, 2020 at 4:09 PM David Kastrup <[email protected]> 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.