Re: Taming Java Libraries in E vs. Joe-e
Kevin Reid <[email protected]>
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On Nov 14, 2008, at 15:18, Jimmy Wylie wrote: > It seems E may use it in its implementation of its own boolean type, > but it may also add or remove things, making a simple comparison > between safej files incomplete. Look at Sugarings in jsrc/org/erights/e/elib/prim/ScriptMaker.java to find the classes which add things. This information *should* be in the safej table but it isn't yet. > I did actually look at Boolean.safej. In both, the method > getBoolean() > was suppressed because it accesses a system property. Joe-E allows > more > methods than E it seems, like toString() and parseBoolean(), but those > seem like methods E wouldn't have to tame because they would be > implemented elsewhere in the E language. getBoolean() is probably suppressed because it would be silly in E - E does not distinguish boxed and unboxed booleans. toString is universally suppressed for several reasons: - the default implementation of it exposes pointer bits (nondeterminism) - all the rest of java.lang.Object's protocol, including toString, is suppressed - E has its own to-string mechanism (E.toString) which has cycle detection and also uses Java classes' toString when appropriate (It's been a while since I looked at this stuff; I may be a little off. MarkM?) > Also, I do have one other question about the safej files. In Joe-E, > they use the static tag and instance tag. In E's safej files, they > use a statics tag and methods tag. Are the methods tag and instance > tag denoting the same methods? I don't know Joe-E, but probably yes. > Or is E using that tag to add its own methods? I noticed in > Boolean.safej that under "methods", E has listed some methods I > couldn't find in the Java API like and(), not(), or(), xor(), and > pick(obj, obj). These are methods added by E (sugar classes, which are defined in a table in SafeJ.java). safej files control methods *after* the E property-mangling, name-mangling and sugaring stages have been applied. (IMO this should not be the case, but I'm not an expert on that aspect of the system.) -- Kevin Reid <http://homepage.mac.com/kpreid/>