Allen's lambda syntax proposal

Breton Slivka zen at zenpsycho.com
Sat Nov 29 23:36:57 PST 2008


Hey, I like that. In the spirit of fun, here's something that does
something weird and random.

var fsm = {
       r: {|| Math.random()<0.5},
       f: {|a| print(a); ( fsm.r() ? fsm.s : fsm.r() ? fsm.m : {||} )("f");},
       s: {|a| print(a); ( fsm.r() ? fsm.m : fsm.r() ? fsm.f : {||} )("s") },
       m: {|a| print(a); ( fsm.r() ? fsm.f : fsm.r() ? fsm.s : {||} )("m");}
}
fsm.f();


More information about the Es-discuss mailing list