[Felix-language] vals

2012-04-17 Thread john skaller
I have been troubled by the semantics of vals for a while. But now I have some progress! Consider: var x = 1; val y = x; var z1 = y; ++x; var z2 = y; ++x; Now, val can be calculate "as control passes through" (eagerly). Or it can be evaluated "when used" (lazily). So: z1 must have value 1, z2 m

[Felix-language] vals and vars

2012-02-02 Thread john skaller
Well this surprised me a bit, this is reading pchannels: val m1 = read(inp); val m2 = read(inp); val m3 = read(inp); eprintln$ "Mainline Read1="+ m1.str; eprintln$ "Mainline Read2="+ m2.str; eprintln$ "Mainline Read3="+ m3.str; Mainline Read1=36 Mainline Read2=16 Mainline