Circo-dev / Circo.jl

A distributed computing platform, designed to scale to millions of nodes and providing metaphoric abstractions.
GNU Lesser General Public License v3.0
2 stars 1 forks source link

Hiding the id from the Actor struct #4

Open tisztamo opened 4 years ago

tisztamo commented 4 years ago

Do not force the user to write boilerplate like

mutable struct TreeActor <: Component
    id::ComponentId
    children::Vector{ComponentId}
    TreeActor() = new(rand(ComponentId), [])
end

The ideal solution would be

mutable struct TreeActor <: Component
    children::Vector{ComponentId}
    TreeActor() = new([])
end

And also providing the alternative

@component TreeActor
    children::Vector{ComponentId}
    TreeActor() = new([])
end