# ⊗ in using

**URL:** <https://discourse.julialang.org/t/in-using/90056>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 10, 2022, 2:59pm UTC](https://discourse.julialang.org/t/in-using/90056 "2022-11-10T14:59:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 10, 2022, 2:59pm UTC](https://discourse.julialang.org/t/in-using/90056/1 "2022-11-10T14:59:58Z")

</div>

I am trying to make

```julia
using TensorCast: ⊗

```

work. For the above I get an `LoadError: "invalid \"using\" statement: expected identifier"`. I tried various combinations of `:` and `()`s, what’s the right way? Eg `import Base: +` just works.

---

<div class="post-metadata">

**Author:** ![RayleighLord](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rayleighlord/32/33592_2.png) [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Post date:** [November 10, 2022, 3:10pm UTC](https://discourse.julialang.org/t/in-using/90056/2 "2022-11-10T15:10:52Z")

</div>

Is `⊗` defined in TensorCast? I try importing some other function that I have seen defined in the package and I do not get any problem. However, it does not seem to find `⊗` .

```julia
julia> import TensorCast: @cast

julia> import TensorCast: ⊗
WARNING: could not import TensorCast.⊗ into Main

```

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [November 10, 2022, 3:30pm UTC](https://discourse.julialang.org/t/in-using/90056/3 "2022-11-10T15:30:36Z")

</div>

I get

```julia
julia> using TensorCast: ⊗
ERROR: UndefVarError: ⊗ not defined

(jl_oVB8Xl) pkg> st
Status `/tmp/jl_oVB8Xl/Project.toml`
  [02d47bb6] TensorCast v0.4.6

julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, haswell)
  Threads: 1 on 8 virtual cores

```

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 10, 2022, 3:48pm UTC](https://discourse.julialang.org/t/in-using/90056/4 "2022-11-10T15:48:49Z")

</div>

I figured it out: `⊗` is just a placeholder that is parsed by the macro, so it does not need to be imported.

The minimal import is

```julia
using TensorCast: @cast, TensorCast

```

since `@cast` expands to calls in `TensorCast` so it needs the module name available (I am not sure if it is possible to implement macros that expand to functions in a module without the module name being imported).

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [November 10, 2022, 4:22pm UTC](https://discourse.julialang.org/t/in-using/90056/5 "2022-11-10T16:22:59Z")

</div>

That sounds like a bug then, the package can (should) interpolate it’s own functions and not rely on whatever names the user have in their namespace.

---

<div class="post-metadata">

**Author:** ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)\
**Post date:** [November 10, 2022, 4:29pm UTC](https://discourse.julialang.org/t/in-using/90056/6 "2022-11-10T16:29:33Z")

</div>

> [@Tamas\_Papp](#):
>
> `⊗` is just a placeholder that is parsed by the macro

That’s exactly right. Like the indices the macro acts on, there is never an object of this name defined.

> [@fredrikekre](#):
>
> the package can (should) interpolate it’s own functions

This is right too.
