zsh-workers
 help / color / mirror / code / Atom feed
* Important discussion about "local" on the POSIX list
@ 2013-10-17  0:27 Bart Schaefer
  2013-10-17  0:51 ` Chet Ramey
  2013-10-17  9:06 ` Peter Stephenson
  0 siblings, 2 replies; 3+ messages in thread
From: Bart Schaefer @ 2013-10-17  0:27 UTC (permalink / raw)
  To: Zsh hackers list

austin-group is discussing a proposal to make local variables
lexical/static in scope, rather than dynamic in scope as in bash and
zsh.

I don't seem to be able to post to that list, so if there's someone
here who still can, please have a gander and chime it.

The discussion ranges over

(1) whether "function name { ... }" vs. "name() { ... }" syntax
determines whether a variable defined within the function has static
scope (ksh93) and the keyword used to declare it is irrelevant;

(2) whether "typeset" or "local" or something else would be used to
declare such variables;

(3) whether "local" would be allowed to have dynamic scope at all.

It would be rather difficult in zsh's implementation to enforce
lexical scoping, so we'd be faced with either giving up POSIX
compliance or doing a massive rewrite.


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

* Re: Important discussion about "local" on the POSIX list
  2013-10-17  0:27 Important discussion about "local" on the POSIX list Bart Schaefer
@ 2013-10-17  0:51 ` Chet Ramey
  2013-10-17  9:06 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: Chet Ramey @ 2013-10-17  0:51 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh hackers list, chet.ramey

On 10/16/13 8:27 PM, Bart Schaefer wrote:
> austin-group is discussing a proposal to make local variables
> lexical/static in scope, rather than dynamic in scope as in bash and
> zsh.

I will object to any change that requires static scoping.  At worst,
scoping rules will be undefined.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/


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

* Re: Important discussion about "local" on the POSIX list
  2013-10-17  0:27 Important discussion about "local" on the POSIX list Bart Schaefer
  2013-10-17  0:51 ` Chet Ramey
@ 2013-10-17  9:06 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2013-10-17  9:06 UTC (permalink / raw)
  To: Zsh hackers list

On Wed, 16 Oct 2013 17:27:34 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> austin-group is discussing a proposal to make local variables
> lexical/static in scope, rather than dynamic in scope as in bash and
> zsh.
> 
> I don't seem to be able to post to that list, so if there's someone
> here who still can, please have a gander and chime it.

I'm not on that list at the moment --- I didn't sign up again when I got
transferred from CSR.

> It would be rather difficult in zsh's implementation to enforce
> lexical scoping, so we'd be faced with either giving up POSIX
> compliance or doing a massive rewrite.

It does seem unlikely we'd be implementing lexical scoping.

If we ever did, it would have to be an option.  The assumption that we
can address local variables in enclosing functions is very widely made
in function suites, presumably including many we never see.

pws


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

end of thread, other threads:[~2013-10-17  9:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-17  0:27 Important discussion about "local" on the POSIX list Bart Schaefer
2013-10-17  0:51 ` Chet Ramey
2013-10-17  9:06 ` Peter Stephenson

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