Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: problem with RANDOM and arrays
- X-seq: zsh-workers 27590
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: problem with RANDOM and arrays
- Date: Mon, 11 Jan 2010 20:58:46 +0000
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=JUyDbDZDP4f0tQxlnGonJUItDZ/pAL9SDnUm7BTz28SmgNGCDLR6Uyh92cQBD+n5/38fOGjmc59PDSXoykV9Hv9lxhbzclTTLImApcGr//vUi+JlHul2zFiLMugEQpwumTFXpEwO4KW+q/VUMtobc3YTMjguEOUM4EPUWYtLG7M= ;
- In-reply-to: <chaz20100111201312.GB3902@xxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <chaz20100111201312.GB3902@xxxxxxxxxxx>
2010-01-11 20:13:12 +0000, Stephane Chazelas:
[...]
> Similar problem:
>
> $ x=0; ((a[++x]++)); echo $x
> 2
>
> All the +=, -=, *=... operators are also affected.
[...]
Strange, their must be something in my .zshrc that affects the
behavior as I get:
$ zsh -c 'x=0; ((a[++x]++)); echo $x'
1
(same with an interactive zsh -f)
The ((a[RANDOM%2+1]++)) problem shows up in any case though.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author