Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: fix some distributed functions that depend on shortloops
- X-seq: zsh-workers 28893
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: fix some distributed functions that depend on shortloops
- Date: Wed, 16 Mar 2011 16:10:33 +0100
- Cc: zsh workers <zsh-workers@xxxxxxx>
- 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=
- In-reply-to: <110304065901.ZM13286@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <AANLkTim4A+Z4_25f_Fku_N=d=cgbhNwiD6jVv9J_7tzB@mail.gmail.com> <110304065901.ZM13286@torch.brasslantern.com>
On 4 March 2011 15:59, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author