I’m writing a parser that has to keep track of many different open files so I have a File
type that contains all the relevant information inside of it. Is there any way to do this on instantiation? Say something like this
mutable struct File
# per-file variables
offset::Int
datas
files = Array{File}()
function File(filename)
file = new() # open new file and set relevant variables
push!(files, file)
end
end
Then I could do something like File.files
or equivalent. This is essentially Type-level fields that behave similarly to private static
fields in C++