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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10250 in the body.
You can then email your comments to 10250 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#10250; Package guile. (Thu, 08 Dec 2011 17:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter TB Brett <peter <at> peter-b.co.uk>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Thu, 08 Dec 2011 17:01:02 GMT) Full text and rfc822 format available.

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

From: Peter TB Brett <peter <at> peter-b.co.uk>
To: <bug-guile <at> gnu.org>
Subject: Problems using optargs with function docstrings
Date: Thu, 08 Dec 2011 11:01:30 +0000
There seems to be a nasty interference between the (ice-9 optargs)
module, Guile's support for function docstrings, and a function's
top-level definition context.

For example, the following works:

(use-modules (ice-9 optargs))
(define* (foo #:optional (bar "baz"))
(define (frob p) (display p) (newline))
(frob bar))
(foo)

with output:

baz

But when you add a docstring, it doesn't.

(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. ;-)

Peter

-- 
Peter Brett <peter <at> peter-b.co.uk>
Remote Sensing Research Group
Surrey Space Centre




Information forwarded to bug-guile <at> gnu.org:
bug#10250; Package guile. (Thu, 08 Dec 2011 23:44:02 GMT) Full text and rfc822 format available.

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"




Information forwarded to bug-guile <at> gnu.org:
bug#10250; Package guile. (Thu, 08 Dec 2011 23:48:01 GMT) Full text and rfc822 format available.

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

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

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

This was with Guile 1.8.7 (guile-5:1.8.7-6.fc14).

-- 
Peter Brett <peter <at> peter-b.co.uk>
Remote Sensing Research Group
Surrey Space Centre




Reply sent to Andy Wingo <wingo <at> pobox.com>:
You have taken responsibility. (Fri, 09 Dec 2011 18:14:02 GMT) Full text and rfc822 format available.

Notification sent to Peter TB Brett <peter <at> peter-b.co.uk>:
bug acknowledged by developer. (Fri, 09 Dec 2011 18:14:02 GMT) Full text and rfc822 format available.

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

From: Andy Wingo <wingo <at> pobox.com>
To: Peter TB Brett <peter <at> peter-b.co.uk>
Cc: Ian Price <ianprice90 <at> googlemail.com>, 10250-done <at> debbugs.gnu.org
Subject: Re: bug#10250: Problems using optargs with function docstrings
Date: Fri, 09 Dec 2011 19:12:43 +0100
On Fri 09 Dec 2011 00:37, Peter TB Brett <peter <at> peter-b.co.uk> writes:

> On Thu, 08 Dec 2011 23:39:22 +0000, Ian Price <ianprice90 <at> googlemail.com>
> wrote:
>
>> Which version are you using? I'm on current stable-2.0(e7b2efd)
>
> This was with Guile 1.8.7 (guile-5:1.8.7-6.fc14).

Sounds like it's fixed in the 2.0.x series.  We would accept a patch to
fix it for 1.8.x, but I'm not going to work on it myself.

Regards, and happy hacking,

Andy
-- 
http://wingolog.org/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 07 Jan 2012 12:24:03 GMT) Full text and rfc822 format available.

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

Previous Next


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