3 ms·
If you're looking for more elegant methods of expressing this in a higher performance runtime, here are two examples. Erlang: [I+9 || I <- lists:seq(1,5), I >=
by rcb 14y ago
If you're looking for more elegant methods of expressing this in a higher performance runtime, here are two examples.
Erlang: [I+9 || I <- lists:seq(1,5), I >= 3]
Haskell: [i+9 | i <- [1..5], i >= 3]
Like go, both Erlang and Haskell both have strong concurrency stories. For an I/O bound server in a production environment, Erlang is a very safe choice.
Compared to these list comprehensions, that ruby example looks unwieldy.
- jasongrout 14y agoEven python looks more readable to me: [i+9 for i in range(1,6) if i>=3]