bugKawa - Bugs: bug #13854, Using EVAL and #!key

 
 

bug #13854: Using EVAL and #!key

Submitted by:  Dean Ferreyra <dferreyra>
Submitted on:  Wed 20 Jul 2005 02:26:21 AM UTC  
 
Category: Scheme languageSeverity: 3 - Normal
Item Group: Run-time exceptionStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 20 Jul 2005 09:15:17 PM UTC, comment #1:

I checked in a fix.

The problem was that keyword arguments have to be passed in an array, as if there was a #!rest argument. I made it to that, using arguable a kludge.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Wed 20 Jul 2005 02:26:21 AM UTC, original submission:

I've boiled down a problem we've run into with the CVS version of Kawa. If I compile and run this code:

(module-static #t)

(eval '(define (f a #!key (msg "nothing"))
msg))

(eval '(begin
(require 'srfi-1)
(f 1)))

I get an ArrayIndexOutOfBoundsException. Comment out the (require ...) line or add a #!rest before the #!key like so:

(eval '(define (f a #!rest rest #!key (msg "nothing"))
msg))

and the problem goes away.

Here's what my compile looks like:

% make PURE=1 default
rm -f *.class
CLASSPATH=.:~/kawa/cvs/kawa-pure-build/kawa-1.7.91.jar java kawa.repl --warn-undefined-variable --module-static-run --main -C test.scm
(compiling test.scm)
CLASSPATH=.:~/kawa/cvs/kawa-pure-build/kawa-1.7.91.jar java test
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at atEvalLevel.applyN(test.scm:3)
at gnu.expr.ModuleBody.apply0(ModuleBody.java:147)
at gnu.expr.ModuleMethod.apply0(ModuleMethod.java:177)
at gnu.expr.ModuleMethod.apply(ModuleMethod.java:151)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:247)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:218)
at kawa.lang.Eval.evalBody(Eval.java:104)
at kawa.lang.Eval.eval(Eval.java:31)
at kawa.lang.Eval.apply(Eval.java:138)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:247)
at gnu.expr.ModuleBody.runCleanup(ModuleBody.java:60)
at gnu.expr.ModuleBody.run(ModuleBody.java:51)
at gnu.expr.ModuleBody.run(ModuleBody.java:32)
at test.<clinit>(test.scm)
make: *** [run] Error 1

Dean Ferreyra <dferreyra>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 20 Jul 2005 09:15:17 PM UTCbothnerStatusNone=>Fixed
  Assigned toNone=>bothner
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1