[e-lang] POLA violation in map-pattern

Kevin Reid kpreid at attglobal.net
Thu May 4 11:03:10 EDT 2006


We're going to fix it anyway for other reasons, but I want to  
document this:

? def evilMap {
 >  to extract(_, d) :any {
 >    println(`I have stolen the $d!`)
 >    return [null, evilMap]
 >  }
 > }
# value: <evilMap>

? def missingMarker {}
# value: <missingMarker>

? def [=> value := missingMarker] | _ := evilMap
# expansion: def m__19 ? (m__19.extract("value", missingMarker) =~  
[value, _]) := evilMap

I have stolen the <missingMarker>!
# value: <evilMap>


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




More information about the e-lang mailing list