-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to v0.2 of MixedStructTypes #972
Conversation
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 #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 |
No changes to the Agents.jl syntax were made, I haven't applied the new syntax |
Fixes #968
Fixes #967
I slightly changed the syntax in that package, and also solved some issues with the macros