Skip to content

Commit e4fedfc

Browse files
committed
underscore macro
1 parent b1dc593 commit e4fedfc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/macros.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Threading macros
22

3-
export @>, @>>, @as, @switch, @or, @dotimes, @once_then, @defonce, isexpr, namify
3+
export @>, @>>, @as, @_, @switch, @or, @dotimes, @once_then, @defonce, isexpr, namify
44

55
isexpr(x::Expr, ts...) = x.head in ts
66
isexpr(x, ts...) = any(T->isa(T, Type) && isa(x, T), ts)
@@ -71,6 +71,10 @@ macro as (as, exs...)
7171
esc(thread(exs...))
7272
end
7373

74+
macro _ (args...)
75+
:(@as $(esc(:_)) $(map(esc, args)...))
76+
end
77+
7478
macro or (exs...)
7579
thread(x) = isexpr(x, :block) ? thread(subexprs(x)...) : x
7680

0 commit comments

Comments
 (0)