Subject: bug#50068: closed (Re: bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambdas)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 29 Aug 2022 16:11:02 +0000

Your bug report

#50068: Curried definitions lose docstrings

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
50068: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50068
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambdas
From: lloda <[email-masked]>
To: Jean Abou Samra <[email-masked]>
Cc: [email-masked]
Date: Mon, 29 Aug 2022 18:10:30 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Applied in 61d8dab8eafd498306ce618582aab37497df77b4. Thank you!

Subject: Curried definitions lose docstrings
From: Jean Abou Samra <[email-masked]>
To: [email-masked]
Date: Sun, 15 Aug 2021 12:13:28 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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.