From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20917 invoked from network); 23 Sep 2003 16:10:15 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Sep 2003 16:10:15 -0000 Received: (qmail 21687 invoked by alias); 23 Sep 2003 16:09:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19128 Received: (qmail 21665 invoked from network); 23 Sep 2003 16:09:47 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 23 Sep 2003 16:09:47 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [217.174.194.138] by sunsite.dk (MessageWall 1.0.8) with SMTP; 23 Sep 2003 16:9:47 -0000 Received: from DervishD.pleyades.net (212.Red-80-35-44.pooles.rima-tde.net [80.35.44.212]) by madrid10.amenworld.com (8.10.2/8.10.2) with ESMTP id h8NG9kg20238 for ; Tue, 23 Sep 2003 18:09:46 +0200 Received: from raul@pleyades.net by DervishD.pleyades.net with local (Exim MTA 2.05) id <1A1plt-0000Cg-00>; Tue, 23 Sep 2003 18:12:13 +0200 Date: Tue, 23 Sep 2003 18:12:13 +0200 From: DervishD To: Zsh Subject: Would this (o) be very difficult to add? Message-ID: <20030923161213.GA772@DervishD> Mail-Followup-To: Zsh Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4i Organization: Pleyades User-Agent: Mutt/1.4i Hi all :) Sometimes we want to do globbing and sort the output randomly: when generating playlists, when generating image slideshows, etc... So I've thought that it would be good if we can do: print -l *(or) print -l *(Or) Please note that since the sort criteria is 'random', (o) and (O) have exactly the same effect... If you use qsort or something like that, a quite simple pseudo-random (we want apparent chaos, not cryptographical quality) order can be achieved using a comparison function that generates a random integer and returns, for example, 'first is greater' if the random integer is even, 'second is greater' if the random integer is odd and 'equal' if the random integer is 0. In fact, if you use the standard qsort behaviour, you can return the random integer minus the randomize range, so it will be <0, 0 or >0 appropriately. If this is not much bloat, I would love having such a glob qualifier :) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.pleyades.net & http://raul.pleyades.net/