Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.compilers    |    Compiler construction, theory, etc. (Mod    |    2,753 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 1,913 of 2,753    |
|    Hans-Peter Diettrich to Paul Biggar    |
|    Re: Unnatural iteration [was: Testing st    |
|    25 Jun 10 23:41:14    |
   
   From: DrDiettrich1@aol.com   
      
   Paul Biggar schrieb:   
      
   >> B B B B FOR n := 1 TO nitems DO processitem (n) DONE   
   >>   
   >> What could be more natural?   
   >   
   > I find this quite unnatural and inelegant, compared to some newer languages:   
   >   
   > Python: for i in items: processitem(i)   
   > Ruby: items.each { |i| processitem i }   
   > Haskell: map processitem items   
      
   The above (Pascal/OPL) For loop allows for aggressive optimization,   
   suitable for fast simple loops. Iterators are bit slower by nature, but   
   such overhead can be neglectable depending on the body of the loop.   
      
   DoDi   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca