Re: Assignment Question
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Feb 26, 2005
- 495 views
On Fri, 25 Feb 2005 09:39:10 -0800, Mario Steele <guest at RapidEuphoria.com> wrote: >cause this is really bugging me how the '$' operator messes up everything. IMHO it doesn't really mess things up, it just changes(for example):
a[idx][idx2]=<expression>
where (bizarrely) <expression> actually changes *a*, to require:
tmp = <expression> a[idx][idx2] = tmp
(While I dislike breaking things, I fully accept this as fair, given we are really only talking about *very* badly written code) But I didn't reply to this to say that... >Between the decloration of the variable namespace, the >assignment operator, and the actual value, there's a type-check done on '1' >to ensure that it'll fit in 'a', NO. Recall the object type. 'a' *is* assigned, and /then/ checked to be integer-ish. (Basically everything in Eu is an object.) Try this:
integer a a={1,2,3}
You'll get an error/ex.err: D:\test.exw:2 type_check failure, a is {1,2,3} Global & Local Variables D:\test.exw: a = {1,2,3} NOTE: a **is** {1,2,3}. All I am saying is Eu actually assigns, and then checks. The interpreter *catches* errors, it does not prevent them. Regards, Pete