[E-Lang] some E oddness.

Mark S. Miller markm@caplet.com
Fri, 07 Sep 2001 09:41:59 -0700


At 02:01 AM Friday 9/7/01, steve jenson wrote:
>I was developing under E tl-8.9.1 for Windows and have recently turned
>that windows box into a Linux machine, and after installed tl-8.9.1b I noticed
>a few problems with some E code I was writing under my Windows installation.
>
>
>These are the first two lines of my code:
>
>def awt__uriGetter := <unsafe:java.awt.*>
>def swing__uriGetter := <unsafe:javax.swing.*>
>
>And when I run the script, I get the following error:
>
># problem: <UndefinedVariableException: unsafe__uriGetter not in scope>
>#          
>#   <interp> evalPrint(e`define awt__uriGetter := unsafe__uriGetter get("java.awt.*")`)

Your Linux installation is operating correctly.  tl-otc-0.8.9.1* does not 
have an unsafe__uriGetter.  This came in on the main development line 
starting at stl-0.8.9s, which was the first version to support locally 
untrusted code.  (Hence the dropping of the "otc-" qualifier, meaning "only 
trusted code".)  In the Es with the otc- modifier, including yours, 
import__uriGetter will get everything.  In the latter versions, 
import__uriGetter would only get emakers and those classes deemed safe, and 
unsafe__uriGetter would get all remaining classes.

I just tried your snippet on my Windows installation of 
tl-otc-0.8.9.1*, and it gives the same error as your Linux installation.  In 
order to program in 0.8.9.1* in a way that will be easy to migrate to 
0.8.10, you should first say

def unsafe__uriGetter := import__uriGetter

after which your code snippet should work fine.  Once you move to 0.8.10, 
you would need to remove all three lines, as 0.8.10's privileged scope (the 
one *.e files evaluate in) predefine all these uriGetters.


>Why did I never notice this before? Is this error always supposed to be
>around? Perhaps I cross-contaminated by E installations on the Windows
>box. Since that machine is no longer running the same OS I have no way
>of going back to see what's up.

That's most unfortunate, because I would have liked to try to diagnose 
what's going on.  I suspect you did indeed cross contaminate, perhaps by 
having a too-inclusive CLASSPATH.  Please let me know what you can remember 
of how you installed tl-otc-0.8.9.1b on your machine.


        Cheers,
        --MarkM