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

Kevin Reid kpreid at mac.com
Fri Feb 12 09:04:15 PST 2010


On Feb 12, 2010, at 11:25, Thomas Leonard wrote:

> 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"])

This should be fixed by changing the expansion to

   throw("no match: " + E.toQuote(temp))

If you could provide a patch for this and/or the line wrapping bug,  
I'll check and commit it.


Also, MarkM and I have agreed you ought to have commit access; the  
only reason you don't yet is that we haven't been able to contact Dean  
to get you added to the password file. (Yes, yes, DVCS is better and  
all that.)


(By the way, if the tracelog is showing intermixed with your regular  
IO, and you haven't done this on purpose or are using devrune, then  
your E is misconfigured or has a bug.)

-- 
Kevin Reid                                  <http://switchb.org/kpreid/>






More information about the e-lang mailing list