Carmack about static analysis

Kapps Kapps at NotValidEmail.com
Sat Dec 24 19:37:12 PST 2011


The two biggest things that I believe D would benefit from, in terms of 
readability, are UFCS and C#-style lambdas (which were already discussed).

Something like
'array(find("test", select!("a.name")(filter!("a.num > 3")(Elements))))'
Could be rewritten much cleaner as
Elements.filter!"a.num > 3"
	.select!"a.name"
	.find("test")
	.array();

The first one is very confusing, hard to split across multiple lines 
without losing meaning, and difficult to see what it even operates on 
(assume Elements is not an array and thus can not be used with the 
current implementation of UFCS). The second one, you can clearly see 
operates on Elements, you can clearly split it across multiple lines, 
and it's very obvious where things stop and end. Plus, it eliminates at 
least one set of parenthesis per function call, not to mention being 
much easier to write as it's in order of steps instead of opposite order.

On 24/12/2011 9:33 AM, Andrei Alexandrescu wrote:
>
> Anyhow, is there anything you have in mind that we have the chance of
> improving at this point?
>



More information about the Digitalmars-d mailing list