-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I'm trying to finally transition from a custom startup.jl snippet to using BasicAutoloads, and another thing I'm struggling with is how new definitons are handled.
Basically, using a name should run the RHS, using .... But defining a new name shouldn't.
Eg, I should be able to do both:
# OK:
julia> mad([1,2,3])
│ Package StatsBase not found, but a package named StatsBase is available from a registry.
│ Install package?
│ (@v1.11) pkg> add StatsBase
└ Select environment:
<...>
1.4826022185056018# (in a new REPL)
# shouldn't try importing the package:
julia> mad = "sane"
│ Package StatsBase not found, but a package named StatsBase is available from a registry.
│ Install package?The snippet I'm using now does that by only handling function/macro calls, as in
if Meta.isexpr(ast, [:macrocall, :call]) && first(ast.args) ∈ symbolslist
...In practice it works well, almost perfect :)
Metadata
Metadata
Assignees
Labels
No labels