Trivial (but not bikeshed please) question of style…

via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 28 06:41:52 PDT 2014


On Tuesday, 28 October 2014 at 08:15:58 UTC, Russel Winder via 
Digitalmars-d wrote:
> 	parent.send(result)
>
> or:
>
> 	send(parent, result)
>
> as being idiomatic D code?

I cannot speak for idioms, but this is a good example of how UFCS 
fails to capture the semantics of dot notation.

"X.action(Y)" will in most OO languages mean do "action" to 
object "X", but "parent.send(results)" means the opposite?! 
That's not good.

"send(parent,result)" is therefore better.


More information about the Digitalmars-d mailing list