[e-lang] Bug (0.8.37d & svn r293): Match-bind expression restricts specimen

Kevin Reid kpreid at mac.com
Thu Jan 18 17:47:09 CST 2007


   ? interp.setExpand(true)

   ? (def x := 1) !~ []
   # expansion: (def [rs__15, &x] := escape ej__9 {
   #                def [] exit ej__9 := def x := 1
   #                __makeList.run(true, &x)
   #            } catch ex__11 {
   #                def br__13 := Ref.broken(ex__11)
   #                __makeList.run(false, br__13)
   #            }
   #            rs__15).not()

   # value: true

   ? x
   # expansion: x

   # problem: <ClassCastException: Integer doesn't coerce to an EList>

Bindings made by the specimen of a match-bind expression do not need  
to be subject to the match-bind failure rules, but are so in the  
current expansion.

I believe x should be 1 rather than a broken slot.

This is a reduced test case from code in Den which worked in earlier  
versions of E. The original code was:

if ((def items := interior.getContentsList()) !~ []) {
   append(lookContentsHeaderDesc)
   for info in items {
     append(...)
   }
} else {
   append(lookOpenDesc)
}

<svn://www.slimy.com/kpreid/den/den/trunk/src/org/cubik/den/behavior/ 
makeInteriorBehavior.emaker>

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list