4 ms·
Nim has a macro in the standard library that allows you to use the actual for loop syntax as a comprehension. let primeSquares = collect: for n in 1..100
by xigoi 1y ago
Nim has a macro in the standard library that allows you to use the actual for loop syntax as a comprehension.
let primeSquares = collect:
for n in 1..100:
if n.isPrime():
n * n