Closed Tortar closed 5 months ago
If I can kindly ask you George, can you give me your opinion on the syntax of https://github.com/JuliaDynamics/MixedStructTypes.jl? Do you think it is okay? :-)
mmh actually again an instance of https://github.com/JuliaDynamics/Agents.jl/issues/963
Hi @Tortar I am available today. I Can review. But this still seems to be WIP, right? What would you like me to review from MixedStructTypes.jl?
It should be ready for review now actually
nevermind for MixedStructTypes.jl, it seems okay to me
right, so what's the status now? what's the syntax, if it changed?
No I mean no changes still to the syntax, will do that in a separate PR, I meant to say that the syntax changed in MixedStructTypes.jl and so I adjusted the macro to the new one
Right. but what is the syntax change? It is not obvious to me by just looking at the readme.
From e.g. :
@sum_struct_type @kwdef A{X} <: AbstractA{X} begin
mutable struct B{X}
a::Tuple{X, X} = (1,1)
b::Tuple{Float64, Float64} = (1.0, 1.0)
end
mutable struct C
a::Tuple{Int, Int} = (2,2)
d::Int32 = Int32(2)
end
mutable struct D
a::Tuple{Int, Int} = (3,3)
const c::Symbol = :s
end
struct E{X}
a::Tuple{X, X} = (3,3)
end
end
to:
@sum_structs A{X} <: AbstractA{X} begin
@kwdef mutable struct B{X}
a::Tuple{X, X} = (1,1)
b::Tuple{Float64, Float64} = (1.0, 1.0)
end
@kwdef mutable struct C
a::Tuple{Int, Int} = (2,2)
d::Int32 = Int32(2)
end
@kwdef mutable struct D
a::Tuple{Int, Int} = (3,3)
const c::Symbol = :s
end
@kwdef struct E{X}
a::Tuple{X, X} = (3,3)
end
end
In practice a shorter name for the macro and a finer control on kwdef (you can apply it to just some structs if you want)
This makes the macros even more similar to just write the structs and apply the macro afterwards
right, but how is its application Agents.jl? do the subagents start with @subagent
or not anymore? I guess its better if they don't? (I also find odd the usage of @kwdef
. can you remove it?) I guess @kwdef
is not in the Agents.jl version.
No changes to the Agents.jl syntax were made, I haven't applied the new syntax @subagent
, etc..., I will do it in another PR, so I think this PR is good to go as it is
Fixes #968 Fixes #967
I slightly changed the syntax in that package, and also solved some issues with the macros