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

 
 

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

Submitter:  Steve Yegge <stevey>
Submitted:  Sat 29 Jan 2005 12:55:09 AM UTC
   
 
Category:  Scheme library Severity:  3 - Normal
Item Group:  Run-time exception Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-01-29 bothner StatusNone Fixed
    Assigned toNone bothner
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code