zsh-workers
 help / color / mirror / code / Atom feed
* typeset -T versus typeset -r, bug or feature?
@ 2006-09-06  3:24 Bart Schaefer
  2006-09-11 13:45 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2006-09-06  3:24 UTC (permalink / raw)
  To: zsh-workers

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
write=right
print $READ


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: typeset -T versus typeset -r, bug or feature?
  2006-09-06  3:24 typeset -T versus typeset -r, bug or feature? Bart Schaefer
@ 2006-09-11 13:45 ` Peter Stephenson
  2006-09-11 15:21   ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2006-09-11 13:45 UTC (permalink / raw)
  To: Zsh hackers list

Bart Schaefer <schaefer@brasslantern.com> 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
right

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
details.

-- 
Peter Stephenson <pws@csr.com>                  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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: typeset -T versus typeset -r, bug or feature?
  2006-09-11 13:45 ` Peter Stephenson
@ 2006-09-11 15:21   ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2006-09-11 15:21 UTC (permalink / raw)
  To: Zsh hackers list

On Sep 11,  2:45pm, Peter Stephenson wrote:
} Subject: Re: typeset -T versus typeset -r, bug or feature?
}
} Bart Schaefer <schaefer@brasslantern.com> 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
} right
} 
} This is a feature.

OK, but note also that write=right did not convert write into a scalar
(see parallel thread about math assignment).  I'm not really griping
about this as it would mean an implicit un-tying, just noting a point
of interest. 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-11 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-06  3:24 typeset -T versus typeset -r, bug or feature? Bart Schaefer
2006-09-11 13:45 ` Peter Stephenson
2006-09-11 15:21   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).