zsh-workers
 help / color / mirror / code / Atom feed
* typeset verbosity
@ 2002-06-12 13:42 Peter Stephenson
  2002-06-12 14:51 ` Oliver Kiddle
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 2002-06-12 13:42 UTC (permalink / raw)
  To: Zsh hackers list

Instead of thinking about hard problems for once, I'd like to get rid of
this annoyance from `typeset' or friends on an existing parameter:

% fn() { local foo; local foo; }
% fn
foo=''
% 

How?

(1) Make the display behaviour optional.  If so, decide when to unset
    the option by default, e.g any sh-style emulation.
(2) Make the display behaviour not work inside functions.  (Making it
    not work on local parameters isn't good enough because of the -g
    flag.)
(3) Make it only work with typeset, or at least not work with local.
(4) Some combination of (1) with the others.

Only (1) can ensure POSIX compatibility.  We could add a flag to display
listed parameters instead.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, 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 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* Re: typeset verbosity
  2002-06-12 13:42 typeset verbosity Peter Stephenson
@ 2002-06-12 14:51 ` Oliver Kiddle
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2002-06-12 14:51 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

On 12 Jun, Peter wrote:

> (1) Make the display behaviour optional.  If so, decide when to unset
>     the option by default, e.g any sh-style emulation.
> (2) Make the display behaviour not work inside functions.  (Making it
>     not work on local parameters isn't good enough because of the -g
>     flag.)
> (3) Make it only work with typeset, or at least not work with local.
> (4) Some combination of (1) with the others.
> 
> Only (1) can ensure POSIX compatibility.  We could add a flag to display
> listed parameters instead.

For POSIX, we really ought to be accepting the -p flag which displays
the listed parameters but in a different format (in the form of a
typeset command). This typically being -L in zsh has probably been
significant in this not being done before. It might actually be a good
idea to add -p as an alternate form of -L across many builtins.

One possibility which is an extension of (3) would be to make it only
work on typeset but not for all the other typeset variants and then follow
bash in changing the documentation so declare is the recommended version
of the command (it's a better name anyway in my opinion). The
KSH_TYPESET option could be extended to make typeset also work that way
for ksh compatibility. Additionally, we could perhaps add a flag to
typeset and variants which could explicity control whether set parameters
are listed.

A related annoyance - autoload being a sort of typeset variant - is that
autoload ~/.zfunc/*(N) will not end silently if there are no files in
~/.zfunc. Changing this could perhaps be a part of whatever solution is
chosen.

Oliver

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.


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

end of thread, other threads:[~2002-06-12 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-12 13:42 typeset verbosity Peter Stephenson
2002-06-12 14:51 ` Oliver Kiddle

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