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

Re: typeset -T versus typeset -r, bug or feature?

Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Do this in an interactive shell so that the third line doesn't cause the
> shell to exit:
> typeset -T READ write
> typeset -r READ
> READ=wrong
zsh: read-only variable: READ
> write=right
> print $READ

This is a feature.  The parameters are different interfaces to the same
information.  "typeset -r write" will work as expected.  This is inevitable
given the current model for internal parameter storage.  I'm not
particularly attached to the current system anyway; parameters are probably
the clunkiest remaining parts of the system, full of ad-hoc tests,
over-complicated but under-powerful interfaces, and accesses into the
system at all sorts of different levels that ought to be implementation

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

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