Julia -e "subtypes(Real)" fails

As simple as that. Any file calling subtypes fails to be run as a script, or loaded with julia -i:

% julia -e "subtypes(Real)"

ERROR: UndefVarError: subtypes not defined
Stacktrace:
 [1] top-level scope at none:1
leandro@pitico:~/Drive/Work/JuliaPlay% ~/programs/julia/julia-
julia-1.4.2/      julia-1.5.1/      julia-1.5.2/      julia-1.5.3/      julia-d562a97f2b/ julia-vim/        
leandro@pitico:~/Drive/Work/JuliaPlay% ~/programs/julia/julia-d562a97f2b/bin/julia -e "subtypes(Real)"
ERROR: UndefVarError: subtypes not defined
Stacktrace:
 [1] top-level scope
   @ none:1

julia> parentmodule(subtypes)
InteractiveUtils

which is only loaded in interactive sessions by default (see the manual).

subtypes is in the InteractiveUtils standard library, you need to load it first. This is done automatically only in the REPL

I know you are huge fan of the manual :slight_smile: but:

If one clicks on subtypes there, one arrives here:

We might guess that with that name that package is not loaded for scripts, but if we click in the entry at the menu, we arrive here: Interactive Utilities · The Julia Language (and nothing again).

So it might be written somewhere, but I can assure you that you are much faster than my docs search :slight_smile: . Thanks again.

the error is clear, it’s not defined, so naturally one finds out where it is defined.

it is also written somewhere REPL loads interactiveutils

Oh yes, sure it is written somewhere. But searching for “REPL” (which I really would never think of facing this problem), leads to: Julia v1.8 Release Notes · The Julia Language

or to this (second entry): Environment Variables · The Julia Language

or to this (third entry): Frequently Asked Questions · The Julia Language

Even if I had “naturally found” where it is defined, I could not deduce if that was expected, or not.

I am not sure where it is written — maybe I just recalled this from somewhere. In any case, perfect opportunity to improve the docs, hence