11 ms·
Is it worse than calling your auto-resizing-sequence type "vector", even though a vector is properly a tuple of (arbitrary) fixed size, and is incomparable with
by jholman 8y ago
Is it worse than calling your auto-resizing-sequence type "vector", even though a vector is properly a tuple of (arbitrary) fixed size, and is incomparable with another thing of any other size?
(okay, I guess it might be worse than that)
- stochastic_monk 8y agoYes, because vector is a library, not part of the core language itself.
- Koshkin 8y agoWell, not just some library. (The 'standard library' should be seen as part of the language.)
- stochastic_monk 8y agoTrue, but there is a huge difference between a standard library feature and a keyword.
- Koshkin 8y agoNot really... Not in the case of the standard library anyway.
- stochastic_monk 8y agoA keyword is a more core part of the language than the standard library. I could re-implement my own vector. I cannot add my own keyword.
- Koshkin 8y agoNo, you cannot/wouldn't reimplement std::vector (not in the sense you are implying). Compiler writers often extend the language with new keywords.
- stochastic_monk 8y agoCan you elaborate on the last point? Do you mean things like macros they use, e.g., concepts lite, or __builtin* functions? I still feel like a standard container is less fundamental than keywords, but I value your perspective.
- Koshkin 8y agoYes, built-ins, intrinsics, and extensions. My original point was simply that std::vector, say, is just as good a "keyword" as any - perhaps, not because you cannot redefine it but because you wouldn't, and if you didn't like what it does, you'd use/implement something else.