Here’s a MWE:
a = 3
b = 4
(This is from the second tutorial on JuliaBox.com.)
These commands work in isolation (i.e. in a cell by their own, these are IJulia notebooks in Jupyter):
"$(a+b)"
"""$a + $b"""
"""$(a+b)"""
"$a + $b"
However the following four commands (each in their own cell of the notebook):
"$a + $b"
"$(a+b)"
"$a + $b"
"""$(a+b)"""
"""$a + $b"""
"$(a+b)"
"""$a + $b"""
"""$(a+b)"""
all produce the same error as follows:
cannot document the following expression:
"$(a + b)"
Stacktrace:
[1] error(::String, ::String, ::Vararg{String,N} where N) at ./error.jl:30
[2] include_string(::String, ::String) at ./loading.jl:522
Similarly, the following four commands (each in their own cell of the notebook):
"$(a+b)"
"$a + $b"
"""$(a+b)"""
"$a + $b"
"$(a+b)"
"""$a + $b"""
"""$(a+b)"""
"""$a + $b"""
all produced the same following error:
cannot document the following expression:
"$(a) + $(b)"
Stacktrace:
[1] error(::String, ::String, ::Vararg{String,N} where N) at ./error.jl:30
[2] include_string(::String, ::String) at ./loading.jl:522
The output of versioninfo()
is as follows:
Julia Version 0.6.2
Commit d386e40c17 (2017-12-13 18:08 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, haswell)
Anyway at first I thought this might be a bug, but upon further reflection that seems more unlikely than me just doing something wrong (because this is literally the first time I have ever used the language).
So if someone could nudge me back into the right direction of how to use the language’s declared variable string features (the syntax is similar to BASH, which I like) I would greatly appreciate it. Thank you for your time and please enjoy your weekend!