Subject: bug#10250: closed (Re: bug#10250: Problems using optargs with function docstrings)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 09 Dec 2011 18:14:02 +0000

Your bug report

#10250: Problems using optargs with function 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].

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

Subject: Re: bug#10250: Problems using optargs with function docstrings
From: Andy Wingo <[email-masked]>
To: Peter TB Brett <[email-masked]>
Cc: Ian Price <[email-masked]>, [email-masked]
Date: Fri, 09 Dec 2011 19:12:43 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

On Fri 09 Dec 2011 00:37, Peter TB Brett <[email-masked]> writes:

> On Thu, 08 Dec 2011 23:39:22 +0000, Ian Price <[email-masked]>
> 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/

Subject: Problems using optargs with function docstrings
From: Peter TB Brett <[email-masked]>
To: <[email-masked]>
Date: Thu, 08 Dec 2011 11:01:30 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

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 <[email-masked]>
Remote Sensing Research Group
Surrey Space Centre