I didn't say they must, just that they are and why. I didn't think that having iterable scalars was a good idea initially, but others felt it was useful and it does seem to be handy quite often.
In any case, I'm not sure what that had to do with EGAL. Clearly 1 and the zero-dimensional array containing 1 are not the same – they don't have the same type, for one thing. But you can still try to make then behave the same way as much as possible. On Sep 12, 2014, at 6:20 PM, [email protected] wrote: >> For the behavior of === you'll want to google "Henry Baker EGAL." >> Essentially two values are === if and only if there is program that can >> distinguish them. There's no way to distinguish two "instances" of 1 since >> integers are immutable. I put instances in quotes because it's not even >> really well-defined what that means for immutable values like 1. > > Wasn't it you who explained that > for i in 1 > print(i) > end > is correct Julia because single values must be considered as dim 0 array? :) > > Actually, > a = 1 > a[1] > is also valid. > > But > a = 1 > a[1] = 2 > is not: is `1` an array or not? > > I guess this is consistent, in a sense ... But still surprising. > > At least, > a = 1 > b = 1 > a === b > true > seems logical now. >
