bugKawa - Bugs: bug #11775, apparently no way to invoke...

 
 

bug #11775: apparently no way to invoke (environment-bound?)

Submitted by:  Steve Yegge <stevey>
Submitted on:  Sat 29 Jan 2005 12:55:09 AM UTC  
 
Category: Scheme librarySeverity: 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.

 

Sat 29 Jan 2005 05:40:51 PM UTC, comment #1:

This was because of the rewrite to use gnu.mapping.Symbol internally, but Scheme still uses String for Scheme symbols (for compatibility with existing code).
I checked in a fix.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sat 29 Jan 2005 12:55:09 AM UTC, original submission:

Bug (Sun JDK5.0, cygwin/xp, kawa-1.7.91 from cvs)

There appears to be no way to invoke the environment-bound?
function without getting a type error. Appears to be a type
mismatch between the scheme side and the java side.

- Function: environment-bound? environment symbol
Return true `#t' if there is a binding for SYMBOL in ENVIRONMENT;
otherwise returns `#f'.

(environment-bound? (interaction-environment) 'base-uri)
Argument #2 (base-uri) to 'gnu.mapping.Environment.isBound(gnu.mapping.Symbol)'
has wrong type (java.lang.String) (java.lang.String)
at gnu.mapping.WrongType.make(WrongType.java:118)
at kawa.lib.misc.isEnvironmentBound(misc.scm:31)
at kawa.lib.misc.apply2(misc.scm:28)
at gnu.expr.ModuleMethod.apply2(ModuleMethod.java:189)
at gnu.expr.ModuleMethod.apply(ModuleMethod.java:157)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:237)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:256)
at kawa.Shell.run(Shell.java:231)
at kawa.Shell.run(Shell.java:177)
at kawa.Shell.run(Shell.java:164)
at kawa.Shell.run(Shell.java:151)
at kawa.repl.main(repl.java:672)
Caused by: java.lang.ClassCastException: java.lang.String
... 11 more

(environment-bound? (interaction-environment) "base-uri")
=> same error

kawa.lib.misc.scm:
(define (environment-bound? (env :: <gnu.mapping.Environment>)
(sym :: <String>))
:: <boolean>
(invoke env 'isBound sym))

gnu.mapping.Environment.java:
public boolean isBound(Symbol key, Object property)
{
Location loc = lookup(key, property);
if (loc == null)
return false;
return loc.isBound();
}

(environment-bound? (interaction-environment)
(make <java.lang.String> "base-uri"))
=> same error

(let ((str :: <String> "base-uri"))
(environment-bound? (interaction-environment) str))
=> same error

Steve Yegge <stevey>

 

(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
Sat 29 Jan 2005 05:40:51 PM UTCbothnerStatusNone=>Fixed
  Assigned toNone=>bothner
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1