if a symbol is readable or writable, like in this example:
protected void foo; public int `foo() { return x; } private void `=foo(int y) { x = y*2; }
then it should be visible, seperating that would only add the ability to make invisible public symbols or publicly visible private symbols. both seem to only create confusion without gain. what i am i missing?
The virtual symbol foo is not publicly readable or writable. It is protected. The function `foo is publicly visible, while the function `=foo is private.
how will the behaviour be with arrays or multisets?
zero_type(({ UNDEFINED })[0]); // this is 1 array a = ({ UNDEFINED }); zero_type(a[0]); // this is 0
Well, it's not really an interesting case, because when you try to index something that has no index in an array you get an exception (like a[1] in this case).
zero_type(indices((< UNDEFINED >))[0]); // this is 1 multiset m = (< UNDEFINED >); zero_type(indices(m)[0]); // this is 1
seems like multisets can store UNDEFINED already.
Well, zero_type(m[UNDEFINED]) gives you 0.