From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26716 invoked by alias); 20 Oct 2015 09:28:18 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20797 Received: (qmail 11180 invoked from network); 20 Oct 2015 09:28:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Date: Tue, 20 Oct 2015 11:22:00 +0200 From: Marc Chantreux To: Zsh hackers list Subject: a little alternative syntax improvement? Message-ID: <20151020092200.GA7518@ramirez.u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) X-Virus-Scanned: ClamAV using ClamSMTP hello, this message is just a proposal but i don't know how naive it is. i just give it a try. alternative syntax for for control statements are really pleasant because the lhs uses the good context # lhs # rhs while ((count-- > 0)) { do_something } while [[ -e $file ]] { do_something } and could be a bit more if the rhs would be context sensitive also: for the moment, you need to write while {next_file} {(( older = last < older ? last : older, count++ ))} when it would be more readable and consistent to write while {next_file} (( older = last < older ? last : older, count++ )) my two cents. regards -- Marc Chantreux (eiro on github and freenode) http://eiro.github.com/ http://eiro.github.com/atom.xml "Don't believe everything you read on the Internet" -- Abraham Lincoln