You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2020. It is now read-only.
Thanks for the amazing work
I'm writing a game economy simulator and, learning a lot from your code.
while studying CurrenciesBase, I was confused about currency struct
struct Currency{C, T} <:AbstractMonetary
val::T
(::Type{Currency{C}})(x::Real) where C =new{C,typeof(x)}(x)
end
T stands for DataType but what does C stands for? after sometime, I realized that it is a type for currency name itself.
But it still makes my head spin when I read Monetary{T,U,V}, and I think providing a different name for CurrencySymbol might be better for code readability.
How about NAME or name for Currency Symbol?
struct Currency{name, T} <:AbstractMonetary
val::T
(::Type{Currency{name}})(x::Real) where name =new{name,typeof(x)}(x)
end+(m::Monetary{name,T,U}, n::Monetary{name,T,U}) where {name,T,U} =Monetary{name,T,U}(m.val + n.val)
This is just naive opinion from non expert. feel free to ignore.
thanks again for sharing your work 😄
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Thanks for the amazing work
I'm writing a game economy simulator and, learning a lot from your code.
while studying CurrenciesBase, I was confused about currency struct
T
stands for DataType but what doesC
stands for? after sometime, I realized that it is a type for currency name itself.But it still makes my head spin when I read
Monetary{T,U,V}
, and I think providing a different name for CurrencySymbol might be better for code readability.How about
NAME
orname
for Currency Symbol?This is just naive opinion from non expert. feel free to ignore.
thanks again for sharing your work 😄
The text was updated successfully, but these errors were encountered: