Subject: bug#10922: closed (Re: bug#10922: procedure-argumets does not work with advanced evaled lambdas)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 06 Jul 2012 12:17:06 +0000

Your bug report

#10922: procedure-argumets does not work with advanced evaled lambdas

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].

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

Subject: Re: bug#10922: procedure-argumets does not work with advanced evaled lambdas
From: Andy Wingo <[email-masked]>
To: Stefan Israelsson Tampe <[email-masked]>
Cc: [email-masked]
Date: Fri, 06 Jul 2012 12:19:51 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Fixed in fc835b1b, thanks for the report.

Andy
-- 
http://wingolog.org/

Subject: procedure-argumets does not work with advanced evaled lambdas
From: Stefan Israelsson Tampe <[email-masked]>
To: [email-masked]
Date: Thu, 1 Mar 2012 22:58:53 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Here is a transcript of the problem

scheme@(guile-user)> (define f (lambda* (#:key x) x))
scheme@(guile-user)> (procedure-arguments f)

$53 = ((required) (optional) (keyword (#:x . 0)) (allow-other-keys? . #f)
(rest . #f))

scheme@(guile-user)> (define f (eval '(lambda* (#:key x) x)
(current-module)))
scheme@(guile-user)> (procedure-arguments f)

$54 = ((required) (optional) (keyword) (allow-other-keys? . #f) (rest .
%args))

Why is this important.

As an example trying to port rackets contract you have functions that take
a function
and return a new function with checks according to a contract added. the
functionality
is the same but input and output is checked. Now to use this, information
about the
keywords are needed in order to do some sanity checks that can be done at
construction
time. But if we eval a lambda and use that, we saw above that the
information is not added.
and the nice idea with contracts is broken.

Solution idea:

mod eval.scm and as described in session.scm make sure to add a 'arglist
procedure-property
to the newly constructed lambda with the appropriate information added.

Regards
Stefan