null references redux + Looney Tunes

language_fan foo at bar.com.invalid
Sun Oct 4 11:12:24 PDT 2009


Sun, 04 Oct 2009 11:08:52 -0500, Andrei Alexandrescu thusly wrote:

> So, you say D lacks built-in
> first-class sum and product types. Yet Tuple is a product type. In spite
> of appearances, it's a built-in type, just that it has no literal.

Not true. A tuple of tuples, for instance, breaks the property (so you 
need struct tuple hacks). The auto-flattening is just harmful. Also, not 
only does it not have a literal, in many places the use has been 
disabled. Recent versions of the compiler have started to throw errors in 
those use cases. Previously I expected it to be fixed, but apparently the 
feature was considered too good to be allowed.

> don't see that a deal breaker. Then I fail to find fault for Algebraic
> (in std.variant) as a sum type. I need to add visitation to it, but
> other than that I don't think Algebraic is worse than a built-in type.

Ok, might be. I have not used it yet. It least it's too verbose for my 
taste. Too much verboseness makes the feature impractical to use.

>> I remember you also suggested all kinds of macro systems, but the
>> discussion died ages ago.
> 
> It hasn't died. We just concluded that it would take many months to
> define and implement a decent macro system. We also had a ton of other
> things to do, so we decided macros have to wait.

Ok.

> I am very familiar with much of Odersky's work and have a lot of respect
> for it. But then Walter created D and has brought his world view in D,
> not someone else's. We can't go like, hey, let's wheelbarrow whatever's
> good in language X into D. That's why I specifically asked "what steps
> we need to take" hoping for much more detail and aim at integration than
> "Scala is good".

I agree you don't need to copy each feature. There just are some open 
problems and it would be really nice if the language could solve them. 
Since D is a practical language, you might say that it doesn't need to 
solve every possible problem (especially not high level problems), just 
some low-level systems programming related ones.

> Regarding the Node-Edge subtyping problem, I'd appreciate a link.

http://lampwww.epfl.ch/~odersky/papers/ScalableComponent.html, page 7 in 
the pdf.



More information about the Digitalmars-d mailing list