TensorCast.jl icon indicating copy to clipboard operation
TensorCast.jl copied to clipboard

Interpolation & scope

Open mcabbott opened this issue 3 years ago • 1 comments
trafficstars

As I was reminded here https://discourse.julialang.org/t/in-using/90056/5 this package tends to assume that the name TensorCast is in scope where the macro runs. It shouldn't.

mcabbott avatar Nov 11 '22 02:11 mcabbott

Thanks for opening an issue. An MWE is

using TensorCast: @cast
B = ones(3, 3)
@cast A[row][col] := B[row, col]

I think that wrapping each function form f(args...) in $(f(args...)) in the macro implementation should fix this, but didn't test.

In addition, it would be great to clarify that is just a placeholder and does not need to be imported.

tpapp avatar Nov 11 '22 08:11 tpapp