GNU bug report logs - #50068
Curried definitions lose docstrings

Previous Next

Package: guile;

Reported by: Jean Abou Samra <jean <at> abou-samra.fr>

Date: Sun, 15 Aug 2021 10:14:02 UTC

Severity: normal

Done: lloda <lloda <at> sarc.name>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: lloda <lloda <at> sarc.name>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#50068: closed (Curried definitions lose docstrings)
Date: Mon, 29 Aug 2022 16:11:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 29 Aug 2022 18:10:30 +0200
with message-id <45ABDE64-579F-4544-9511-CFAD0EAB3CF3 <at> sarc.name>
and subject line Re: bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambdas
has caused the debbugs.gnu.org bug report #50068,
regarding Curried definitions lose docstrings
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
50068: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50068
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jean Abou Samra <jean <at> abou-samra.fr>
To: bug-guile <at> gnu.org
Subject: Curried definitions lose docstrings
Date: Sun, 15 Aug 2021 12:13:28 +0200
When a docstring is used in the body of a curried definition,
it ends up on the result of the application of the resulting
curried function, not on the function itself. Example:

(use-modules (ice-9 curried-definitions))

(define ((curried a) b)
  "Docstring of curried"
  'whatever)

(procedure-documentation curried)
=> #f

(procedure-documentation (curried 'whatnot))
=> "Docstring of curried"


This is apparently because Guile translates

(define ((curried a) b)
  ...)

to

(define (curried a)
  (lambda (b)
    ...))

which puts the docstring in the body
of lambda.

Tested with Guile 2.2 and 3.0.5.


[Message part 3 (message/rfc822, inline)]
From: lloda <lloda <at> sarc.name>
To: Jean Abou Samra <jean <at> abou-samra.fr>
Cc: 50068-done <at> debbugs.gnu.org
Subject: Re: bug#50068: [PATCH] In curried definitions, move docstrings to
 outermost lambdas
Date: Mon, 29 Aug 2022 18:10:30 +0200
Applied in 61d8dab8eafd498306ce618582aab37497df77b4. Thank you!




This bug report was last modified 2 years and 262 days ago.

Previous Next


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