Killing the comma operator
ZombineDev via Digitalmars-d
digitalmars-d at puremagic.com
Wed May 11 02:39:44 PDT 2016
On Wednesday, 11 May 2016 at 09:06:40 UTC, Kagamin wrote:
> On Wednesday, 11 May 2016 at 00:32:33 UTC, Mithun Hunsur wrote:
>> +1. The comma operator should go, especially if it makes tuple
>> syntax possible.
>
> To clarify a possible misunderstanding: tuples are possible in
> D3, and macros, and concepts, and parametric polymorphism.
By "parametric polymorphism" do you mean multiple
dispatch/multimethods? This can sort of be emulated in library.
Think something like Variant.visit that takes multiple variants
as parameters. So building it into the language doesn't seem like
it should be a priority.
Concepts are the wrong solution to the problem and probably would
never happen. The design of std.experimental.allocator proves
that they are inadequate for solving even simple problems like
static polymorphism.
Macros... well I think a solution like Jonathan Blow's Jai CTFE
inside the compiler would be much more powerful and easy to
integrate into the language. But it will require heavy
refactoring of DMDFE, but this is a good idea regardless.
Tuples and some sort of pattern matching for values (like is() is
for types) are a total must have. Though if we get rid of the
comma operator, it may happen earlier than D3. From watching D's
evolution from last 2-3 years I think that there may never be a
D3. Just cool new features that every other release, and graceful
deprecation of old misfeatures.
More information about the Digitalmars-d
mailing list