UFCS for templates

Dicebot public at dicebot.lv
Fri Aug 9 05:35:39 PDT 2013


On Friday, 9 August 2013 at 12:22:51 UTC, Ary Borenszweig wrote:
> Come on, in this case I don't think he needs to provide a 
> motivating use case.
>
> What's the motivating use case for UFCS in the first place? You 
> can live without it just fine, only the syntax is uglier. Being 
> able to call a function "foo" whose first argument is of type T 
> as T.foo is nice and uniform.

It wasn't community proposal so same logic does not apply here. 
Walter does what he believes is right - it is up to us to 
convince him if something is proposed that does not get in line 
with his ideas. It is his language after all.

However, if you ask, it does add important design tool similar to 
extension methods and prevent temptation to stockpile dozens of 
utility functions in aggregates. One needs to show that similar 
issue exists with templates.

> Not having the same for templates is *not* uniform, and code 
> tends to get uglier.
>
> That's his use case.

It is not a use case. Use case is specific code snippet in two 
forms - before the proposal implementation and after. With formal 
analysis of benefits.


More information about the Digitalmars-d mailing list