From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7929 invoked by alias); 29 Sep 2014 20:53:39 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33287 Received: (qmail 3646 invoked from network); 29 Sep 2014 20:53:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=1A24d3aIZumaLbvdc+ViPJt5q7QigLLbEqxU6wT7g2I=; b=UJTab/Fi9kSOnNWYmDgo0fjiNzeqaZtp/TRl2DwyVQtZCzG3l3JYP9S4Js9469sJxk hjIK++1Fy2GkVOO1ff86AX9FSypIYfwTuhcNoBBmQJLNIkZDiN0XJl76ygG3AphBintz 4saL+dxlNbJVA5pVl6QXGYuVH2Rtw1yHMPeicPFD+17SX66/yXdf31G/AAEIfY3wbdwk b12NvzR91rbo4s2cd1Pfh6ZUeN9DSQ/2SEa8dVBaELzdOGKP5czNqhNNepodNpikfCeA lZR3apFqxnzIUoESuJfeBklbzl4+QccjFM5uJiT/ORxte2UyvoT9kxUvYyzU5l1M3TFR rWpw== X-Gm-Message-State: ALoCoQmoi71kEYVWilDSiMHQ3IQj1DT1rK9GxMIaHZT1Hgcn1HAz20hJQguVI4ek6uJUIfBpEQiv MIME-Version: 1.0 X-Received: by 10.180.182.12 with SMTP id ea12mr488719wic.21.1412024001233; Mon, 29 Sep 2014 13:53:21 -0700 (PDT) In-Reply-To: <20140929205236.2eb5e622@pws-pc.ntlworld.com> References: <20140929205236.2eb5e622@pws-pc.ntlworld.com> Date: Mon, 29 Sep 2014 13:53:21 -0700 Message-ID: Subject: Re: PATCH: functions with redirections From: Bart Schaefer To: Peter Stephenson Cc: Zsh hackers list Content-Type: multipart/alternative; boundary=047d7b66f2e3023a2f05043a7593 --047d7b66f2e3023a2f05043a7593 Content-Type: text/plain; charset=UTF-8 On Sep 29, 2014 12:52 PM, "Peter Stephenson" wrote: > > This seems to add the ability to define functions with redirections that > take effect when the function is run. Parsing didn't actually need > changing at all, despite what I said a few days ago --- we already parse > the redirections, it's just a question of saving them at the definition > and digging them back out when executing. Pardon me for asking when I haven't had a chance to try it yet, but does this work right if redirection of the same FD appears both at the time of def'n and at the time of call? E.g. in bash: foo() { echo foo; } >&3 foo 3>&2 first dups 3 from 2 and then dups 1 from 3, so "foo" is echo'd to stderr. > I haven't yet looked at dump files. That's partly becuase I don't > understand them and partly because I don't use them. Any hints would be > great. By dump files do you mean zcompile? I fear I'm not of much help there. > If anyone wants something else to do they can think about whether I've > introduced any subtle memory leaks. I wouldn't expect any that would fool valgrind on a few simple examples. --047d7b66f2e3023a2f05043a7593--