bugKawa - Bugs: bug #22451, Access to variables in environment...

 
 

bug #22451: Access to variables in environment from compiled code

Submitted by:  None
Submitted on:  Sat 01 Mar 2008 05:40:58 PM UTC  
 
Category: Code generationSeverity: 3 - Normal
Item Group: Unexpected resultStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sun 23 Mar 2008 08:14:17 PM UTC, comment #1:

I'm not sure what's going on - a complete setlf-contains test program would help.

One suspicious thing is
new Scheme().getnewEnvironment()'- that shouldn't be needed: If you do 'new Scheme()' that automatically calls getNewEnvironment(). So 'new Scheme().getEnvironment()' makes more sense.

A high-priority item on my TODO list cleaning up and documenting better the Scheme-from-Java API, and in a way compatible with javax.script.

Per Bothner <bothner>
Project Administrator
Sat 01 Mar 2008 05:40:58 PM UTC, original submission:

A location set in an environment from Java is not accessed from compiled code or scripts (or not always!), only its first binding.

Example:

Environment env = new Scheme().getnewEnvironment();

env.put("self",b1);

Scheme.eval("(define (getInternalInfluence)
(invoke (as <mimosa.scheduler.DefaultState> self) 'getInternalInfluence))",env);
==> call of the function use b1 as the value of self, OK

env.put("self",b2);
==> call of the function STILL USE b1
I replaced self by (eval 'self (interaction-environment)) and it works (but it is just a work-around!!)

Unfortunately, it is always like that!! When I use a script referencing a location set differently in different environments, only the first binding is used...very bad for what I have to do

HELP PLEASE

Anonymous

 

(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

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  •  

    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):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup