[e-lang] Announcing development snapshot 0.8.36m: No more kernel MatchBindExpr

Mark S. Miller markm at cs.jhu.edu
Sat May 6 09:31:12 EDT 2006


As of development snapshot 0.8.36m, available at 
<http://www.erights.org/download/0-8-36/index.html>, the match-bind expression 
is no longer part of Kernel-E. Instead, the left-to-right trinary define has 
replaced the old right-to-left trinary define, and a match-bind expression in 
Kernel-E expands to uses of escape and define, as discussed in previous email. 
In the expansions shown here, where a "def pattern := ..." appears, the actual 
Kernel-E node is a left-to-right trinary define. But for readability, when 
there was no scoping conflict in showing it right to left, then it renders 
itself as "def pattern := ...".


     ? interp.setExpand(true)
     ? 3 =~ x
     # expansion: def sp__11 := 3
     #            def [rs__19, &x] := escape ej__13 {
     #                def x := (sp__11, ej__13)
     #                __makeList.run(true, &x)
     #            } catch ex__15 {
     #                def br__17 := Ref.broken(ex__15)
     #                __makeList.run(false, br__17)
     #            }
     #            rs__19

     # value: true

     ? x
     # expansion: x

     # value: 3

     ? 3 =~ [y,z]
     # expansion: def sp__21 := 3
     #            def [rs__29, &z, &y] := escape ej__23 {
     #                def [y, z] := (sp__21, ej__23)
     #                __makeList.run(true, &z, &y)
     #            } catch ex__25 {
     #                def br__27 := Ref.broken(ex__25)
     #                __makeList.run(false, br__27, br__27)
     #            }
     #            rs__29

     # value: false

     ? y
     # expansion: y

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

     ? &y
     # expansion: &y

     # value: <ref broken by problem: <ClassCastException: \
     #         Integer doesn't coerce to an EList>>


0.8.36m is a development snapshot and not a release candidate because various 
productions that were defined to expand to match-bind expressions still are. 
These match-bind expressions then expand as above. The result is correctness 
preserving (and CapDesk still runs), but it voluminous, slow, and unreadable:


     ? if ((def a := true) || (def b := false)) {&b}
     # expansion: if (def sp__111 := {
     #                      if (def a := true) {
     #                          def sp__91 := null
     #                          def [rs__99, &b] := escape ej__93 {
     #                              def [&b] := (sp__91, ej__93)
     #                              __makeList.run(true, &b)
     #                          } catch ex__95 {
     #                              def br__97 := Ref.broken(ex__95)
     #                              __makeList.run(false, br__97)
     #                          }
     #                          rs__99
     #                          __makeList.run(&b, &a)
     #                      } else {
     #                          if (def b := false) {
     #                              def sp__101 := null
     #                              def [rs__109, &a] := escape ej__103 {
     #                                  def [&a] := (sp__101, ej__103)
     #                                  __makeList.run(true, &a)
     #                              } catch ex__105 {
     #                                  def br__107 := Ref.broken(ex__105)
     #                                  __makeList.run(false, br__107)
     #                              }
     #                              rs__109
     #                              __makeList.run(&b, &a)
     #                          } else {
     #                              null
     #                          }
     #                      }
     #                  }
     #                  def [rs__119, &a, &b] := escape ej__113 {
     #                      def [&b, &a] := (sp__111, ej__113)
     #                      __makeList.run(true, &a, &b)
     #                  } catch ex__115 {
     #                      def br__117 := Ref.broken(ex__115)
     #                      __makeList.run(false, br__117, br__117)
     #                  }
     #                  rs__119) {
     #                &b
     #            } else {
     #                null
     #            }

     # value: <ref broken by problem: <NullPointerException: \
     #         must be an EList rather than null>>

Once these expansions are fixed, I expect to announce the next release 
candidate for E-on-Java.

-- 
Text by me above is hereby placed in the public domain

     Cheers,
     --MarkM



More information about the e-lang mailing list