Initialize an Empty Array of Tuples in Julia
我不知道如何初始化一个空的元组数组。 该手册说:
The type of a tuple of values is the tuple of types of values... Accordingly, a tuple of types can be used anywhere a type is expected.
但这不起作用:
1 | myarray = (Int64,Int64)[] |
但这确实是:
1 | Int64[] |
空方括号前面似乎应该有一个类型,但是元组类型不起作用。 这种
顺便说一句,我的用例是创建一个初始长度不确定的数组,并在循环中将元组推入数组。
您可以为此执行
对于寻求最新解决方案的人,
同样,详细的方法
它创建一个
请注意,在v1.0中,您需要编写