From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10394 invoked by alias); 16 Mar 2011 15:15:51 -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: 28893 Received: (qmail 3966 invoked from network); 16 Mar 2011 15:15:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ZFlwCXJSHi56+P81Ed+j5QvnoLxxq2SKiGALh8SDx2U=; b=R8K2lRC8vs+RhOLa/Yl3QwzSn5f44pPmwQps/US7wkpGsSdgPwDC+u3NQBrfPPhllI RYTM17lpeQk7Ox1WMfDuPDsDaofxjwpWOVZD4FXFMnr417L/h+RgYXSmIYDXqyeHw4dU cJzP1+cJu4DuPsXU0J4k9AVGeKqIJYNl+lilo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Gy+PvYRv3QlQ5kj8hpzQW33ojLWw+MnYZrvH3g4zuLXzLPKycjTlLzerV5J5+Ppfw5 yvYCrTPAXERIo4rqTEup1hDn+NBK113YoJMK1yQNcZL7LCnfS9a7uzeozYfGp73E/Qus g1WHsV/fitemU/y9a1df/stTte28NuIbYdRHU= MIME-Version: 1.0 In-Reply-To: <110304065901.ZM13286@torch.brasslantern.com> References: <110304065901.ZM13286@torch.brasslantern.com> Date: Wed, 16 Mar 2011 16:10:33 +0100 Message-ID: Subject: Re: fix some distributed functions that depend on shortloops From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 4 March 2011 15:59, Bart Schaefer wrote: > Hmm, this one is a conundrum. My first instinct would be to add -R to > the "emulate" command at the top, rather than try to fix every native > zsh-ism in the source; certainly that's correct for zargs, but it may > not be for match-words-by-style if there are completion-related options > that would be reset by that. > > OTOH -R is supposed to avoid changing options that affect the interactive > behavior, so maybe it's a bug that emaulate -R changes e.g. completeinword. Well, except for the first one, the changes are also improvements :). skip=10000 % time ( repeat $skip charskip+=\? ) ( repeat $skip; do; charskip+=\? ; done; ) 0.07s user 0.00s system 97% cpu 0.071 total % time ( charskip=${(l:skip::?:)} ) ( charskip=${(l:skip::?:)} ; ) 0.00s user 0.00s system 53% cpu 0.002 total % time ( for (( i=1; i < 10000; i++ )) { } ) ( for ((i=1; i < 10000; i++ )) do; ; done; ) 0.01s user 0.00s system 93% cpu 0.015 total % time ( for (( i=1; i < 10000; i++ )) : ) ( for ((i=1; i < 10000; i++ )) do; :; done; ) 0.02s user 0.01s system 96% cpu 0.031 total Even if there is some better general way to fix this, I don't think fixing stuff to not use short_loops hurts in any way. All other usages of repeat already use the long form, though that may be because they have larger bodies. -- Mikael Magnusson