3 ms·
Not surprising its nearly identical to how you would write it in Io (http://iolanguage.com http://iolanguage.com): square := method(x, x * x) 1 to(10)
by draegtun 15y ago
Not surprising its nearly identical to how you would write it in Io (http://iolanguage.com http://iolanguage.com):
square := method(x, x * x)
1 to(10) map(x, square(x)) sum println
and also the variation:
1 to(10) map(x, x * x) sum println