Closed mbauman closed 8 years ago
Great work.
TBH, this example is starting to make me a little worried that we're playing the "what edge case have I still forgotten game" that I've played with macros for NA
In DataArrays. Is indexing really the only thing we're losing?
Works for my use case in IterativeSolvers.
(This version no longer works as posted because b_ata = @benchmark B = m≥n ? A*A' : A'A
is no longer supported on master. The replacement code is
makeata(A) = (size(A, 1) ≥ size(A,2) ? A*A' : A'A)
B = makeata(A)
b_ata = @benchmark makeata(A)
which is rather annoying, but works.)
Yeah, it's frustrating. expand
also handles setindex and macrocalls... and maybe a few other things too. But expand(:(svds(A, nsv=3)))
is so ridiculously complicated that I don't want to deal with it. I suppose we could try to expand it only if it's not already a function call.
Alright, after thinking through this a bit more, I think it's ok to conditionally call expand
. I've also added very basic regression tests that start enforcing the cases we support.
Bump. I just hit this and came looking.
Unfortunately this fix breaks benchmarking indexing assignments because calling
expand
on a keyword function call does all sorts of crazy things to the AST. I suppose we could handle it, but it is really messy. I suppose I'm okay giving up@benchmark A[I]
.Fixes #32.