On 20/08/2012, at 5:35 PM, Dobes Vandermeer wrote: > > I don't feel confused about it. I'm very clear that "unspecified" shouldn't > be the default!
You're very clear because you don't understand what the impact is. It may be possible to actually find out: just fiddle the parser so everywhere a "val" is used, or default is var (including function parameters) is secretly changed to a var. Ie. completely get fid of vals. You will be able to address them but if you're code with the old grammar was ok you won't be doing that in the new version. > I think the semantics of a val SHOULD be that it uses the state of variables > as they were at the time the val was initialized; you don't seem to think > this is necessary. Instead you're saying that the semantics are okay as > being "the calculation is performed using the state of variables as selected > by the compiler." This basically means that to get predictable results you > shouldn't use vars or call functions or you'll get behavior that varies based > on the decisions made by the optimizer. Yes. The semantics of val is deliberate. Use vars if you don't like it. There's no excuse for explicit val/var choice. For cases where the specifier is omitted and the default is val, you have a stronger argument. > So you already know it's a booby trap, from experience. Why not fix it for > future programmers? As I have said many times: I do not know how. In fact a lot of this discussion was started by considering "const" being added. If you take "const" to mean "pure total strict" then consts could be evaluated eagerly or lazily without any change in behaviour, and we might be able to change the semantics of val since the key feature is now captured by const. The problem with this is that "const" has severe constraints on it. It may have nice properties once you have one, but if you can only initialise one with consts (and const functions) you may find you cannot use them. So I'm not sure this is actually a solution. But you can see I'm trying to attack the problem. -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language