On Tuesday, 28 October 2014 at 16:02:03 UTC, Steven Schveighoffer wrote:
I don't think recipient.send(mail) is that unintuitive. It's how I would visualize it from a contact application for instance.

sender.send(mail) ?

Consistency about direction is important when you choose names and syntax. I think in general that message passing "obj.method()" should be used when the function is either mutating the object or is an activity that the object has a sense of ownership on.


UFCS breaks this distinction, e.g.:

arr.sort()  // inline mutating sort

vs.

sort(arr)  // functional pure sort


Chaining would be better done using a pipelining syntax:

stringarr -> sort -> reverse -> join!", " -> file.write;

gen_pairs() -> (k,v) => (k,v,v*v) -> takestriplet -> auto result;

Reply via email to