Hello,

I am looking for an example how to use the setfield function.
(see: http://docs.julialang.org/en/release-0.2/stdlib/base/ )

The following does not work (setfield is not called when the field time is 
set):

using ProtoBuf
import ProtoBuf.meta

type AutopilotLog
    time::Float64
    counter::Int32
    number::Int32
    AutopilotLog() = (x = new(); fillunset(x); x)
end #type AutopilotLog
meta(t::Type{AutopilotLog}) = meta(t, Symbol[:time,:counter], Int[], 
Dict{Symbol,Any}())
function setfield(value, time::Symbol, x)
        x.time = value
        println("abc")
end

log = AutopilotLog()
log.time = 0.0

Any hint what I am doing wrong?

Regards:

Uwe (using Julia 0.21)

Reply via email to