Re: Bugs Mark S. Miller (markm@erights.org)
Sat, 05 Dec 1998 02:00:25 -0800

At 03:52 PM 12/4/98 , Bill Frantz on The Earth wrote:
>? test toString(16)
># problem: java.lang.ArrayIndexOutOfBoundsException: 0
>
># excuse: java.lang.ArrayIndexOutOfBoundsException: 0
>
>? test toString(10)
># problem: java.lang.ArrayIndexOutOfBoundsException: 0
>
># excuse: java.lang.ArrayIndexOutOfBoundsException: 0

Just to clarify, this is indeed a bug, but not the one it seems. Currently, E's floating point numbers have no one-argument toString method (and no other simple way I know of to get them to print in an alternate radix). The ArrayIndexOutOfBoundsException should instead be a NoSuchMethodException. This bug happens when the receiver does have a method of the same name but a different arity; in this case, a zero-argument toString method. This will be fixed.

>Bug 2:
>
>The Elmer menu doesn't show "copy", only "paste" with a section of the
>window selected. However Ctl-C does "copy" it to the clip board, which is
>how the data for bug 1 got to Eudora.

My approach in building the current bad Elmer-in-Java prototype was first to try to build the equivalent of a simple Notepad like text editor -- Jed. Elmer then enhances Jed by recognizing the updoc conventions and invoking the E interpreter. In using Swing to build Jed, I could not figure out how to cleanly have menu enabled/disabled states track what was happening in the document. Jed has several such bugs including the one you hit, and Elmer inherits them.

Ping is planning to reimplement Elmer in E. However, he'd still probably be building on Swing, so the issue remains. I think the above separation also makes sense: first solve the problem of building a simple Notepad like editor, then worry about enhancing it with knowledge of updoc & E. *Surely* it's straightforward to build such a simple editor cleanly and correctly using Swing -- I didn't dive into it far enough to give it a fair shake. I wouldn't be surprised if there are already working examples on the CD-ROMs that came with my Swing books.

Ping, does this all sound right to you?

	Cheers,
	--MarkM