GNU bug report logs -
#10922
procedure-argumets does not work with advanced evaled lambdas
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]
This bug report was last modified 12 years and 327 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.