Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh-workers 43616, typeset doesn't report tied parameters



Hello Stephane,
Hello folks,


regarding patch 43616 i would like to ask the following.
cites from patch:

1)
+When an existing scalar is tied to a new array, the value of the scalar
+is preserved but no attribute other than export will be preserved.

2)
+ More generally, the readonly attribute should not be relied on as a security
+ mechanism.

3)
+ Special variables that have been made readonly retain their value
+and readonly attribute when made local.


IMHO 1+2 are inconsistent with 3.
What 1 means is, if a readonly scalar is tied to an array. the content of the
scalar is changeable through the array interface.
At least in 5.6.2 that works that way, so this is not new.

Not sure if that is the best way to handle that situation.
In other shells AFAIK a readonly is unchangeable.

IMHO when a readonly is tied, the newly tied var (either scalar or array what
ever comes last) should take over the content AND the readonly flag in one go.
OR a readonly should not be tieable at all.

Leaving it the way as currently is inconsistent IMHO.


kind regards,

     Thilo






Messages sorted by: Reverse Date, Date, Thread, Author