Hacker News new | ask | show | jobs
by nicoster 3478 days ago
for the list comprehension, why not

``` do_whatever(Keys, SomeParameter) -> [case external_lookup(Key) of {ok, V} -> do_side_effecty_thing(V, SomeParameter); {error, R} -> report_some_failure(R) end || Key <- Keys], ok. ```

or

``` [begin some_func(Key), other_func(Key) end || Key <- Keys]. ```

if only the value of other_func() needs to be in the result list.

2 comments

FWIW HN does not do markdown[0], let alone markdown extensions like triple-backtick code blocks.

[0] it implements a very small subset of markdown badly: emphasis (with no escape so it tends to break when you try to use multiplication signs in your comments) and indented "code" blocks

HN works fine with multiplication signs ("×"), it's asterisks that are problematic.
use 4 spaces in front of code lines instead of ```