reuse mapt

This commit is contained in:
Mike J Innes 2017-03-17 01:04:41 +00:00
parent d27d59b071
commit 7ef6e295cb
1 changed files with 1 additions and 4 deletions

View File

@ -51,10 +51,7 @@ infer(::typeof(+), a, b) = a
# Shapes macro
_shape(xs::AbstractArray) = size(xs)
_shape(xs::Tuple) = map(_shape, xs)
macro shapes(ex)
@capture(ex, f_(args__)) || error("@shapes f(args...)")
:(shapes($(esc(f)), _shape(($(map(esc, args)...),))...))
:(shapes($(esc(f)), mapt(size, ($(map(esc, args)...),))...))
end