Hi!

----

RFE: Allow ISO C-like |for()|-loops in arithmetic expressions (and
allow the usage of ';' to seperate arithmetric expressions, e.g. ((
i=0 ; j=1 )) ).

While digging in some more complex arithmetic stuff I noticed that
lots of scripts have code like this:
-- snip --
for (( i=0 ; i < chicken ; i+=monster )) ; do
    (( array[i]=i*chicken+monster ))
done
(( monster++ ))
-- snip --

... the issue is that the repeated entering and leaving an arithmetric
expression is slow and looks... ugly.

IMO it may be better if a |for()|-loop like the one above could be
expressed like this:
-- snip --
((
    for( i=0 ; i < chicken ; i+=monster )
        array[i]=i*chicken+monster;

    monster++;
))
-- snip --
... IMO it looks a bit cleaner and is likely faster since the whole
loop is now done in a single arithmetic expression.

Comments/rants/etc. welcome...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to