FWIW, here's the modern Python equivalent to "1..10.odd.sqr.lt(50)"<p><pre><code> >>> [s for i in range(50) if i&1 and (s:=i*i) < 50]
[1, 9, 25, 49]
</code></pre>
And here's my interpretation of the C equivalent:<p><pre><code> #include <stdio.h>
int main() {
int i, s;
for(i = 1; i <= 10; i++) {
if (i & 1 && (s = i*i) < 50) {
printf("%d ", s);
}
}
return 0;
}
</code></pre>
Not quite a-la 1972, but then again the example 1972 code from that page wouldn't compile then either - variables had to be declared at the start of the function.<p>I wonder what the APL looks like. I hacked this solution:<p><pre><code> (x<50)/x←(1=2|x)/x←((⍳10)*2)
</code></pre>
but I'm guessing the real solution would be 1/3 the size.