Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

a little alternative syntax improvement?



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



Messages sorted by: Reverse Date, Date, Thread, Author