Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
losvedir
4y ago
0 comments
Share
Hm, this works and is about as terse as `pattern_tap`:
:erlang.localtime() |> case do; {_, {h,m,_}} -> {h, m}; end |> do_something
Not that I'd want to do that in production code, but I felt a bit nerd-sniped here, to see the shortest way I could find without dependencies.
0 comments
default
newest
oldest
klibertp
4y ago
That's actually what pattern_tap's tap macro expands into :) See:
https://github.com/mgwidmann/elixir-pattern_tap/blob/master/...
j
/
k
navigate · click thread line to collapse