Name: Anonymous 2014-01-20 18:58
what is you're opinion on foreache loops?
i don't like em cuz they ache in the fore
i don't like em cuz they ache in the fore
for
unless you've got a damn good reason.foreach
when I want to Map
. foreach
is a control construct map
is a function.
int pointless;
for (int i = 0; i % 13 != 0; i += 3) {
pointless = i;
}
foreach
with something like break
and return
or a "Knuth style" mutli-body foreach
construct with by
clauses. yield
) and you'll get a generator, which is a stream, but not a loop.
for (it = begin(collection); it.has_next(); it.advance())
obviously the for loop itself isn't the stream, the iterator is the stream, the for loop is just the consumer of the streamYes. obviously.
foreach
and other control constructs. #include <super/special.h>
int main(void)
{
return yay();
}
In opposition to many cake eaters from my university, I believe that ideas behind Sglib are good because of my former research on modern (and generic) programming languages and because of my current work on a refactoring browser for C.A page about a data structure ``library''* isn't the place to put snide comments about former classmates, well-deserved though that comment may be. That's not a condemnation of the code, but given the quality of other writings/projects I've seen from authors who made such comments, I was reluctant to trust the vague technical claims that this author makes. Still, this would not be significant in my overall choice to use the library, were I to make one.
SGLIB_LIST_LEN
. Linear time? What the fuck? If that's the price I have to pay for not linking against anything, no thank you.SGLIB_LIST_LEN. Linear time? What the fuck? If that's the price I have to pay for not linking against anything, no thank you.