I trying to learn about intervals in a Pluto notebook using both IntervalArithmetic and Measurements.
I understandably get the error in the thread title when I try to use
± to replicate the notebook extract here:
The code replicates fine if IntervalArithmetic is not used but I want to be able to use both packages within the one Pluto notebook.
Normally I get around this problem with PackageName.function. However, this doesn’t work here. I have tried following this page:
Modules · The Julia Language *
- If I try
using Measurements: ± as mpmthen replace
.mpmI get a syntax error
syntax: space before "." not allowed in "((a .* x) .+ rand(d, N)) . at *filename and path*"
- If I try
Measurements.:.(±)I get the same syntax error
- if I try
using IntervalArithmetic: ± as iapmthis only brings in that one feature from the package but I want to use
..and all the other features
Any suggestions? My preference would be to get option 2 working.
The parent module may be accessible using a chain of submodules like
Base.Mathis called the module path . Due to syntactic ambiguities, qualifying a name that contains only symbols, such as an operator, requires inserting a colon, e.g.
Base.:+. A small number of operators additionally require parentheses, e.g.
- Use the
askeyword above to rename one or both identifiers, eg
julia> using .A: f as f julia> using .B: f as g
B.f available as
g. Here, we are assuming that you did not use
using A before, which would have brought
f into the namespace.