duck!

Leandro Lucarella luca at llucax.com.ar
Sat Oct 16 09:06:44 PDT 2010


Andrei Alexandrescu, el 16 de octubre a las 08:54 me escribiste:
> On 10/16/10 1:35 CDT, Leandro Lucarella wrote:
> >Kagamin, el 15 de octubre a las 17:16 me escribiste:
> >>Andrei Alexandrescu Wrote:
> >>
> >>>I was talking to Walter about Kenji's adaptTo. We both think it's a very
> >>>powerful enabler, but adaptTo is a bland name. After discussing a few
> >>>marketing strategies, I proposed "duck". It's short, simple, and evokes
> >>>"duck typing".
> >>
> >>1. adaptTo helped me to understand what it does, while duck!Drawable doesn't.
> >
> >I agree, just "adapt" might be an option, it even has a precedence of
> >something similar in Python (even when the PEP[1] was rejected, PEAK has
> >an implementation[2]). But "duck" is really cryptic (as symbol names
> >invented by Andrei usually are :).
> 
> Walter recognized it instantly, as I think most should. Isn't "duck
> typing" really spread out there?

Walter and you have the same convoluted brain, I can understand why he
instantly recognize it ;)

I already made my point, it make no sense to keep defending my position
since, evidently, is a pure subjective matter.

I just think auto a_bird = duck!Bird(a_duck) is not obvious at all
compared to auto a_bird = adapt!Bird(a_duck). I even think adaptTo is
even cleaner, and I tend to hate long names, specially when camelCase is
involved, but since you didn't like it I, as others, suggested simply
adapt). If one could write auto a_bird = adapt!a_duck(Bird), adapt would
be as clear as adaptTo is with the current syntax. With adaptTo!Type you
even have the precedent of the to!Type template, so it seems like a nice
extension.

F*ck, I finally kept defending my position...

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Si ella es la flor, yo soy la espina
Si ella es quien florece, yo quien se marchita
Y estamos en eclipse total, y estamos en eclipse total
Completamente cruzados, completamente cruzados


More information about the Digitalmars-d mailing list