zsh-workers
 help / color / mirror / code / Atom feed
From: Robert F Tobler <rft@raven.cg.tuwien.ac.at>
To: Zsh Workers <zsh-workers@math.gatech.edu>
Subject: local variable setting problem/bug
Date: Tue, 19 Nov 96 22:31:39 +0100	[thread overview]
Message-ID: <9611192131.AA25535@raven.cg.tuwien.ac.at> (raw)

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/


             reply	other threads:[~1996-11-19 22:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-19 21:31 Robert F Tobler [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9611192131.AA25535@raven.cg.tuwien.ac.at \
    --to=rft@raven.cg.tuwien.ac.at \
    --cc=rft@cg.tuwien.ac.at \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).