5 ms·
for the list comprehension, why not ``` do_whatever(Keys, SomeParameter) -> [case external_lookup(Key) of {ok, V} -> do_side_effecty_thing(V, SomeP
by nicoster 10y 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.
- masklinn 10y agoFWIW 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
- dragonwriter 10y agoHN works fine with multiplication signs ("×"), it's asterisks that are problematic.
- detaro 10y agouse 4 spaces in front of code lines instead of ```