3 ms·
I was just assuming the zyroth's example was in Java, since that is what the article's author favored. Not sure where you guys got the idea that it was C. But,
by Xichekolas 19y ago
I was just assuming the zyroth's example was in Java, since that is what the article's author favored. Not sure where you guys got the idea that it was C.
But, just to cover all bases, it wouldn't work as Java either. This would though.
int[] x = {1, 2, 3};
for (int i = 0; i < 3; i++) { x[i] *= 2; }
Yet another reason to use:
(mapcar #'(lambda (x) (* x 2)) '(1 2 3))
... you don't have to think about whether array indexes start at zero or one.