Last active
December 21, 2018 07:02
-
-
Save passindro/57f373466917eb3538a7b8c56b81bf6c to your computer and use it in GitHub Desktop.
For Redy@thautwarm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function emmmm(expr, guard) | |
@match expr begin | |
:(function $_(a, b, $(_...), $last) | |
$(block...) end) | |
where guard(last) => (last, block) | |
end | |
end | |
head = x->x[1] | |
guard = islowercase ∘ head ∘ string | |
emmmm( | |
:(function f(a, b, c, d, e)_ | |
print(e) | |
end), | |
guard) | |
# => | |
# (:e, Any[:(#= REPL[17]:1 =#), :_, :(#= REPL[17]:2 =#), :(print(e))]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment