Some minor bugs (switch and traceln)

Thomas Leonard <tal-v5nx5w6akNyLE8xUarVfuPLx9OUvmyODWmv/[email protected]>
Newsgroups gmane.comp.lang.e.general
Organization IT Innovation
Message-ID <[email protected]>
A couple of minor bugs:

When there is no match for a switch statement, the expansion
(ENodeBuilder.switchx) is:

  throw("no match: " + temp) 

This leads to errors such as:

? switch (["hello"]) { }

=== 2010-02-12T16:21:04.362Z (Twine.add:Twine.java:345) WRN
eruntime: Twine + non-Twine EList : (['n', 'o', ' ', 'm', 'a', 't', 'c', 'h', ':', ' ', "hello"])
 @ Twine#add(Object)
 @ add/1
 @ EExpr#evalToPair(Scope)
 @ evalToPair/1: <jar:file:/opt/src/e/export/dist/e.jar!/org/erights/e/elang/cmd/cmdMakerMaker.emaker#:span::129:57::129:66>
# problem: <ClassCastException: ConstListImpl doesn't coerce to a RuntimeException>
#
#   - Thrower#run(RuntimeException)
#   . throw(['n', 'o', ' ', 'm', 'a', 't', 'c', 'h', ':', ' ', "hello"])
#   @ run/1
#   - EExpr#evalToPair(Scope)
#   . e`{\n    def specimen__5 := ...tch: ".add(specimen__5))\n}`.evalToPair(<a Scope>)
#   @ evalToPair/1: <jar:file:/opt/src/e/export/dist/e.jar!/org/erights/e/elang/cmd/cmdMakerMaker.emaker#:span::129:57::129:66>

Secondly, the line wrapping code in Traceln.java loses a character when
wrapping:

?  traceln("." * 74 + "12345")
=== 2010-02-12T16:22:36.069Z (Traceln.traceit:Traceln.java:89) WRN
__main: 
> ..........................................................................12\
> 45

(though really I'd prefer to disable the wrapping entirely and have the
terminal deal with it; that way I could have my logs as wide or narrow
as I like and copy-and-paste would work correctly)

Thanks,


-- 
Dr Thomas Leonard
IT Innovation Centre
2 Venture Road
Southampton
Hampshire SO16 7NP

Tel: +44 0 23 8076 0834
Fax: +44 0 23 8076 0833
mailto:tal-v5nx5w6akNyLE8xUarVfuPLx9OUvmyODWmv/[email protected]
http://www.it-innovation.soton.ac.uk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.