From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19884 invoked by alias); 30 Sep 2016 07:05:12 -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: 39512 Received: (qmail 27975 invoked from network); 30 Sep 2016 07:05:12 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(0.0/5.0):. Processed in 0.142293 secs); 30 Sep 2016 07:05:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=9DjEb2TpXgP3Hou7 SWOO/N/+3dk=; b=NfQ052GDwu3QxM908zLoQkJNPVPfAqWbqiW6Gc1cjnHu/rnJ c+GVrdjtPDTwoHnAxQDnMEzXcoQu6WtQeeRR7VmRm9j/oSdirKPmf9lagiH8Ia1r QTaeYNycVYZaHJKLNgQv1axbNfcC2uOOfMiBxQFOSxRbhPOY4Qv0E4mGNik= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=9DjEb2TpXgP3Hou 7SWOO/N/+3dk=; b=YgSu47tONn2SBq1BqZKACg7UxIWAf77tl5bTwFHQelAlwx+ 0tbt2ztVSvcxpoEyqs2uZOCpp7loMKGOhPeBH8pjy98N6O7pqFTHkkTx8mpEAn/3 psvsfDNGKwRQsRS6zi+ur7ra4pv5jvzRgkb34SUOKf1NDfh7i2XiiGUf2p8I= X-Sasl-enc: mGT9AArNBWqLPUcQALZQoTbm9WNwVjQUUQVA2aTI//Hz 1475219108 Date: Fri, 30 Sep 2016 07:03:47 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: _dispatch (was Re: PATCH: [for consideration] TMPSUFFIX) Message-ID: <20160930070347.GC23665@fujitsu.shahaf.local2> References: <160925155112.ZM23899@torch.brasslantern.com> <20160926072546.GA28316@fujitsu.shahaf.local2> <160926091922.ZM26758@torch.brasslantern.com> <20160927070039.GA20798@fujitsu.shahaf.local2> <160927122050.ZM13394@torch.brasslantern.com> <20160928102417.GA2729@fujitsu.shahaf.local2> <160928114917.ZM32186@torch.brasslantern.com> <20160929063916.GA4351@fujitsu.shahaf.local2> <160929003047.ZM27818@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <160929003047.ZM27818@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Thu, Sep 29, 2016 at 00:30:47 -0700: > On Sep 29, 6:39am, Daniel Shahaf wrote: > } > } It might be easier to just give a flag to eval that means "propagate > } errflag of the evaluated expression to the calling scope"? So the eval > } itself would be aborted/unrolled, too. > > I don't think this is a significant enough problem to warrant changing > the definition of "eval" (if by "give a flag" you mean "add a -e option" > for some variant of -e). > Yes, that's what I meant. In terms if your idea, I think my idea was to have ERRFLAG_EVAL automatically convert back to ERRFLAG_ERROR iff -e was passed to eval — i.e., not by default. > However, if it were possible for the "eval" builtin to know when it > was inside an "always" construct and propagate a new ERRFLAG_EVAL > out to where TRY_BLOCK_ERROR could reflect it, that might work. > The important bit would be that ERRFLAG_EVAL never converts directly > back into ERRFLAG_ERROR, so if the script ignores TRY_BLOCK_ERROR > then all errors disappear at the end of the always-block. > > Or something like that. This makes sense, but wouldn't it also require some way for the always block to (manually) set ERRFLAG_ERROR again upon an ERRFLAG_EVAL, in order to "abort enough code" (which was the original issue)? The interface could be a new builtin, or a setfn on TRY_BLOCK_ERROR; the important thing is that then the always block finishes ERRFLAG_ERROR would be set. Cheers, Daniel