Re:Kotlin Money
by Exerosis on Tuesday October 08, 2024 @10:29AM
(#41777781)
My complaint is, bit too much infix :( What about 50.btc 25.usd
Keeps it inline with the time API as well with 20.seconds and what not.
[ Parent
| on HN ]
Re:Kotlin Money
by eriksencosta on Tuesday October 08, 2024 @03:00PM
(#41780593)
Thanks for commenting! I'm still learning Kotlin and I overlooked the usage of get() with vals. This will be the next syntactic sugar into the mix. I think it makes sense.
When I was designing the API, I created methods like toUSD() and toEUR(). But with 306+ circulating/tender currencies and 2000+ cryptocurrencies, I thought it could lead to a bad experience when using code completion.