GNU bug report logs - #10250
Problems using optargs with function docstrings

Previous Next

Package: guile;

Reported by: Peter TB Brett <peter <at> peter-b.co.uk>

Date: Thu, 8 Dec 2011 17:01:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 10250 <at> debbugs.gnu.org (full text, mbox):

From: Ian Price <ianprice90 <at> googlemail.com>
To: Peter TB Brett <peter <at> peter-b.co.uk>
Cc: 10250 <at> debbugs.gnu.org
Subject: Re: bug#10250: Problems using optargs with function docstrings
Date: Thu, 08 Dec 2011 23:39:22 +0000
Peter TB Brett <peter <at> peter-b.co.uk> writes:

> (use-modules (ice-9 optargs))
> (define* (foo #:optional (bar "baz"))
> "Docs go here"
> (define (frob p) (display p) (newline))
> (frob bar))
> (foo)
>
> This generates an error:
>
> ERROR: In procedure memoization:
> ERROR: Bad define placement (define (frob p) (display p) (newline)).
>
> I'm not sure if this is a bug, but it looks like one to me. ;-)
I'd agree, if I could reproduce it

scheme@(guile−user)> (use-modules (ice-9 optargs))
(define* (foo #:optional (bar "baz"))
"Docs go here"
(define (frob p) (display p) (newline))
(frob bar))
(foo)
baz
scheme@(guile−user)> ,describe foo
Docs go here
scheme@(guile−user)> 

Which version are you using? I'm on current stable-2.0(e7b2efd)

-- 
Ian Price

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"




This bug report was last modified 13 years and 168 days ago.

Previous Next


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