From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.6/8.7.3) with ESMTP id JAA09250 for ; Wed, 20 Nov 1996 09:03:13 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id QAA09785; Tue, 19 Nov 1996 16:31:26 -0500 (EST) Resent-Date: Tue, 19 Nov 1996 16:31:26 -0500 (EST) Message-Id: <9611192131.AA25535@raven.cg.tuwien.ac.at> Content-Type: text/plain Mime-Version: 1.0 (NeXT Mail 3.3 v118.2) X-Image-Url: http://www.cg.tuwien.ac.at/~rft/XImage/1996-01-15.tiff X-Nextstep-Mailer: Mail 3.3 (Enhance 1.3) Original-Received: by NeXT.Mailer (1.118.2) PP-warning: Illegal Received field on preceding line From: Robert F Tobler Date: Tue, 19 Nov 96 22:31:39 +0100 To: Zsh Workers Subject: local variable setting problem/bug Reply-To: rft@cg.tuwien.ac.at Resent-Message-ID: <"KjPmd.0.pO2.jSYao"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2433 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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/