发布于 2022-05-04 06:03:49
不能将破折号用作变量名的一部分,因为它是减法运算符:
julia> x = 5
5
julia> y = 2
2
julia> x-y
3因此,没有办法区分x minus y和a variable called "x-y"。使用下划线代替:
julia> struct My_Struct end
julia> struct My-Struct end
ERROR: syntax: invalid type signature around REPL[47]:1
Stacktrace:
[1] top-level scope
@ REPL[47]:1https://stackoverflow.com/questions/72106325
复制相似问题