[E-Lang] some E oddness AND Discussion of the Promise architecture

steve jenson stevej@sieve.net
Mon, 10 Sep 2001 15:34:56 -0700


Quoting Mark S. Miller (markm@caplet.com):

]]> 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()'.

What's strange is that I'm getting the string "null" for the values of
the properties using your code. 

? def props := interp getProps()
# value: {interp.interactive=true}

 
? for i in props propertyNames() {
>     println(`$i => ${props[i]}`)
> }
e.vendor.url.bug => null
java.runtime.name => null
sun.boot.library.path => null
[the rest removed]

Anyway, I don't wish to waste any of your time on this, I think there a lot
more important matters. Unless you see something or know of something that
I'm obviously doing wrong.


regards,
steve

-- 
steve jenson <stevej@sieve.net> http://sieve.net/
PGP fingerprint: 79D0 4836 11E4 A43A 0179  FC97 3AE2 008E 1E57 6138
"If a listener nods their head while you explain your program, wake them up."