I am trying to define a tree node as a mutable struct
in Julia v1.0, But I get the error
syntax: too few type parameters specified in "new{...}"
below is the MWE. Google points me to this fully switch static parameter syntax to `where` · Issue #11310 · JuliaLang/julia · GitHub, but the content is quite cryptic, so how do I fix this error? I have a feeling that it has something to with T <: Real
but I don’t how to fix.
module JLBoostTrees
mutable struct JLBoostTreeNode{T <: Real}
weight::T
children::Vector{JLBoostTreeNode}
JLBoostTreeNode(w) = new(w, JLBoostTreeNode[])
end
end
I am doing this on JuliaBox and I don’t have access to v0.7 at work, and I think there might others with the same question, so posting here for the benefit of all.