3 ms·
Yes, the special for loop syntax is to make it consistent with the "pfor" syntax. The "pfor" syntax is that way so that it can be parallelized. Also, I can't b
by zhemao 13y ago
Yes, the special for loop syntax is to make it consistent with the "pfor" syntax. The "pfor" syntax is that way so that it can be parallelized.
Also, I can't believe I forgot to mention this in the post, but both for and pfor can sweep multiple iterators, so
for (i in 0:10, j in 0:5) {
}
Is equivalent to
for (i = 0; i < 10; i++) {
for (j = 0; j < 5; j++) {
}
}
- melonakos 13y agoHey, @zhemao, wasn't kidding about wanting to talk about bringing you on board here. Seriously takes a lot of talent to do what you've done :)
- zhemao 13y agoHey thanks. I've actually already accepted a full-time offer from Amazon, so I'm not looking around anymore. My teammates have all accepted full-time offers from other companies as well.
- kika 13y agoWhen I was about your age I've joined IBM for 6 years. The work was great and I liked everything I did there (well, at least for the first 3 years). In the hindsight though I realize that I basically wasted these years.
- melonakos 13y agoAh, OK. Well, it's never too late to say no to the BigCo and join a startup :) * http://notonlyluck.com/2013/07/23/reasons-to-join-a-startup-over-a-bigco/ http://notonlyluck.com/2013/07/23/reasons-to-join-a-startup-... * http://notonlyluck.com/2013/07/24/more-thoughts-on-reasons-to-join-a-startup-over-a-bigco/ http://notonlyluck.com/2013/07/24/more-thoughts-on-reasons-t...
- goldenkey 13y agoStartup culture is a cancer. Quite trying to sway him from true greatness. All hail Emperor Bozos.
- 14113 13y agoAh, interesting. Of course, you can do the same thing in one for loop in C like so: for(i=0,j=0;i<10;j=(j+1)%5, j==0?i++:){ } Not that you ever would of course, but it does demonstrate the power of for loops in C.