zsh-workers
 help / color / mirror / code / Atom feed
* local variable setting problem/bug
@ 1996-11-19 21:31 Robert F Tobler
  1996-11-20  1:41 ` Zoltan Hidvegi
  0 siblings, 1 reply; 5+ messages in thread
From: Robert F Tobler @ 1996-11-19 21:31 UTC (permalink / raw)
  To: Zsh Workers

I encountered the following problem when writing a function (this is in zsh  
3.00 on Nextstep, confirmed in zsh 3.01 on Nextstep, zsh 3.00 on Irix and zsh  
2.6-beta13 on linux:

I wanted to create local variables and set them to empty lists (could  
probably done more elegantly, or is maybe unnecessary, but I did it this way):

    myfun ()
    {
	local aopt=() eopt=() dopt=()
	...	

Since the 'locality' did not work I found out that introducing the empty  
lists produced the following effect (using 'functions' to print out what zsh  
thinks about 'myfun'):

    myfun () {
	    local aopt= () {
		    eopt=() dopt=()
	    }
	    ...

This in itself is highly nonintuitive: I guess the first =() is interpreted
as a start of a new function definition, as opposed to a variable
initialization the way I think it should be (or am I mistaken? - I haven't
programmed zsh all that long).

But even worse than that, try the following function:

    bug()
    {
	local a=()
	local b
	local c
    }

On Nextstep 3.3 running zsh 3.00 or zsh 3.01 (with -f option) I get:
	zsh: 24224 segmentation fault  zsh -f

On Linux 1.3.52 running zsh 2.6-beta13 I get (after a while):
	zsh: fatal error: out of memory

And on Irix 5.2 running zsh 3.00 it also consumes memory and
won't terminate normally.

Nevertheless I am very fond of zsh, and therefore I hope you can fix this problem!

------------------------------------------------------------------------
  Robert F. Tobler                 -  tel:+43(1)58801-4585,fax:5874932
  Institute of Computer Graphics   -  mailto:rft@cg.tuwien.ac.at
  Vienna University of Technology  -  http://www.cg.tuwien.ac.at/~rft/


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

end of thread, other threads:[~1996-11-20 19:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-19 21:31 local variable setting problem/bug Robert F Tobler
1996-11-20  1:41 ` Zoltan Hidvegi
1996-11-20  2:02   ` Hrvoje Niksic
1996-11-20 15:33     ` Zoltan Hidvegi
1996-11-20 19:32       ` Hrvoje Niksic

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