[E-Lang] some E oddness AND Announcement of the E bug tracking system.

Mark S. Miller markm@caplet.com
Sun, 09 Sep 2001 07:32:23 -0700


At 01:32 AM Sunday 9/9/01, steve jenson wrote:
>> I presume you are using emakers here, because in simple E programs
>> JPanel__quasiParser always is in scope.
>
>Actually, no. I'm in Elmer. Something else that's interesting is when
>I try and look at my Properties with the following code:
>
>for i => in interp getProps() {
>   println(`$i => $k`)
>}
>
>I only see:
>
>interp.interactive => true
>
>
>where I'm used to seeing screens of properties. Is this the normal behavior
>for 8.9.1*? I think maybe I'm just too used to 0.8.9*

True for both of these issues.  In 0.8.9.1*, you have to define 
JPanel__quasiParser yourself, as you are now doing.  It was added to the 
privileged scope since your version.

And to enumerate the properties, do

    ? def props := interp getProps()
    # value: {interp.interactive=true}
    
    ? for name in props propertyNames() {
    >     println(`$name => ${props[name]}`)
    > }
    ... the properties ...

In 0.8.9.1*, getProps() returned a java.util.Properties object, which is a 
strange kind of collection.  Properties subclass Hashtable, but they also 
inherit (by delegation sort of) from each other.  Seen through the hash 
table protocol, indexing (ie, get/1, ie, "[<index>]") includes inherited 
properties, but normal enumeration (which is used by the for loop) does not. 
However, Properties provides an alternate enumeration method, 
propertyNames/0, which does include inherited properties.

In E >= 0.8.9t, we pre-flatten the properties into our own well behaved (and 
immutable!) ConstMap, which is returned by 'interp getProps()'.


        Cheers,
        --MarkM