unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#50068: Curried definitions lose docstrings
@ 2021-08-15 10:13 Jean Abou Samra
  2022-03-28 23:25 ` bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambda Jean Abou Samra
  2022-08-26 11:00 ` bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambdas Jean Abou Samra
  0 siblings, 2 replies; 5+ messages in thread
From: Jean Abou Samra @ 2021-08-15 10:13 UTC (permalink / raw)
  To: 50068

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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-29 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15 10:13 bug#50068: Curried definitions lose docstrings Jean Abou Samra
2022-03-28 23:25 ` bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambda Jean Abou Samra
2022-08-26 11:00 ` bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambdas Jean Abou Samra
2022-08-29 16:10   ` lloda
2022-08-29 16:15     ` Jean Abou Samra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).