4 ms·
> Usually with languages that are feature rich they can be plain library types. Eh, in most languages you'd still need language support if you want quaternion
by masklinn 10y ago
> Usually with languages that are feature rich they can be plain library types.
Eh, in most languages you'd still need language support if you want quaternion literals.
- int_19h 10y agoLiterals are usually not a big issue. You don't get that much in going from "1 + 2i" to "complex(1, 2)" or something like that. It's value type semantics, operator overloading, and implicit conversions that are usually challenging. Go doesn't have any form of customized operator overloading. If something needs to look like a number, it has to be in the base language. Stuff that isn't, is second-class even if it's in the standard library. Ironically, this is the case for big integer / floating-point numbers - you have to write things like x.Add(y, z): https://golang.org/pkg/math/big/ https://golang.org/pkg/math/big/