|
@kwdef struct HydrogenAtom |
|
Z = 1 |
|
mₑ = 1.0 |
|
a₀ = 1.0 |
|
Eₕ = 1.0 |
|
ℏ = 1.0 |
|
end |
has all fields in the HydrogenAtom types as Any. Even if you don't care about performance, this is not a good idea:
julia> HA = HydrogenAtom(Z="1")
Antique.HydrogenAtom(Z=1, mₑ=1.0, a₀=1.0, Eₕ=1.0, ħ=1.0)
julia> E(HA)
ERROR: MethodError: no method matching -(::String)
My recommendations would be the proof-of-concept implementation
If you want to support both a full ASCII and a Unicode API, then I don't think you can use @kwdef. If you stick to ASCII (which I might, at the end of the day, just because it put so much less demand on contributors of new models), and @kwdef is probably possible.
This applies to all models, obviously, not just HydrogenAtom
Ref. openjournals/joss-reviews#8545 (comment)
Antique.jl/src/HydrogenAtom.jl
Lines 4 to 10 in ad463ca
has all fields in the
HydrogenAtomtypes asAny. Even if you don't care about performance, this is not a good idea:My recommendations would be the proof-of-concept implementation
If you want to support both a full ASCII and a Unicode API, then I don't think you can use
@kwdef. If you stick to ASCII (which I might, at the end of the day, just because it put so much less demand on contributors of new models), and@kwdefis probably possible.This applies to all models, obviously, not just
HydrogenAtomRef. openjournals/joss-reviews#8545 (comment)