3 ms·
Correct, tagged pointers are just for pointer unions, a value union could be emulated using the transmute builtin function. A more general mechanism for discrim
by nickmqb 8y ago
Correct, tagged pointers are just for pointer unions, a value union could be emulated using the transmute builtin function. A more general mechanism for discriminated unions is on the roadmap. It would have been nice to include it for the initial version, but I've been in stealth mode for too long already so really needed to launch ;).
Re: whitespace, see my comment here: https://news.ycombinator.com/item?id=19599908 https://news.ycombinator.com/item?id=19599908
I'm not worried about single letter generic param names being too restrictive. Having more than 2 or 3 type params usually implies some fairly heavy abstraction, which is not really in the spirit of the language.
- saagarjha 8y agoMy concern with generic parameters was that I might have situations where both of them start with the same letter so I have to assign an unrelated letter to one of them (for example, say a type generic over an Iterator and Index: one of them can be I and the other one would be…J?)
- nickmqb 8y agoGood point, I agree that's a bit of an awkward case. It's something I'm planning to keep an eye on. If this becomes a problem in practice, we can do something about it.