[e-lang] Some minor bugs (switch and traceln)

Thomas Leonard tal at it-innovation.soton.ac.uk
Fri Feb 12 08:25:48 PST 2010


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 at it-innovation.soton.ac.uk
http://www.it-innovation.soton.ac.uk 



More information about the e-lang mailing list