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

Re: Nasty bug in array-element typeset assignments

Borsenkow Andrej wrote:
> > "Bart Schaefer" wrote:
> > >         local 'foo[1]'=X
> >
> > Is this supposed to be supported?  I certainly haven't done anything about
> > it.
> >
> Yes, recent changes has enabled it.

Yuk.  Whoever decided on this has got a job on their hands.

> I suspect, typeset is confused ... we
> ask for foo[1] that does not yet exist, so dereferencing gives us outer foo
> ...

Typeset is going to get *very* confused.  Each change like this multiplies,
rather than adds to, the complexity of the already complicated typeset
code.  When you add to this the restore sequence, which is handled at the
end of function scope with no detailed knowledge of what typeset has been
up to, you've got something very difficult to maintain (which, personally,
I'm not proposing to attempt).  Good luck.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

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