"Me Here" (>), John (>>), Carl (>>>), Patrick (>>>>): >> >> But yes, I expect that it will be caught as >> > > a compile-time error. >> >> >> > >> > And do you agree it's reasonable to expect this of every compiler? >> >> I think that is the point of declared types. But, something like >> >> no strong_type_check :rw >> >> in scope can turn that off, in case you want to play dirty tricks. > > What is the point of be able to mark things readonly if the compiler > does reject assignment attempts?
Oh, as long as you predeclare that you're breaking the rules, I'm fine. We're not making stuff impossible just for the heck of it -- this isn't Java. > What is the point of marking things readonly if you can turn it off? There are many possible reasons, I think. * The code that declares the variable readonly might not be available to you (compiled to bytecode, fetched by RCP etc), * or it might be available but used by other clients which expect the variable to be read-only. * You might be writing a one-time hack, which can be done the easy way by turning off read-only checking. * You might be writing test code, which is greatly simplified by your just reaching in an changing the damn thing. In short, I have no problem with _turning off_ read-only checking. That, I think, can be done on a suit-yourself basis. I'm arguing for _having_ read-only checking at compile level (which everyone seemingly agrees on), and spec-requiring of a compiler to check this (and here opinions divide). // Carl