On Friday, July 27, 2018 03:41:29 Sameer Pradhan via Digitalmars-d wrote:
> In the end I thought I might as well dump my thoughts on the D
> forum and hear straight from the horse's (or horses')
> mouth(s)---so to speak.

It evolved out of D's member function call syntax for arrays - basically,
for years before we had UFCS in D, we had UFCS for arrays. However, when and
how that was added to arrays, I don't know. I don't recall it ever not being
in the language, but I never used D1, and I don't know if it had it. At
minimum, it's been in D since early D2, if not much earlier. I'd have to do
a lot of spelunking through old releases to figure out when it was added.

Certainly, the origins of UFCS in D do not come from making it possible to
extend user-defined types with member functions. It comes from wanting
member function call syntax when using arrays (probably aimed primarily at
strings, but I don't know). It's just that later it was proposed to extend
it so that it would work with any type and thus make the member function
call syntax universal.

- Jonathan M Davis

Reply via email to