Lazy eval
Walter Bright
newshound at digitalmars.com
Tue Aug 22 16:22:59 PDT 2006
BCS wrote:
> Thinking of it that way, changing the API from one to the other is
> *never* safe. This means that using a T delegate() as a parameter might
> as well be considered an unsafe practice. If you started with just T,
> your locked in for all time. Starting with T delegate() is almost as bad.
>
> Having a feature that is nearly impossible to use safely may well be
> worse than not having the feature.
Changing the API is always problematic, including with traditional
features like implicit conversions, inout, etc. As I posted before, the
pragmatic way to change an API is to create a new name with the new
interface, and deprecate the old one. This is not a problem that is new
or unique to delegate conversions. It's as old as programming.
As for delegate conversions being nearly impossible to use safely, I
don't understand that at all. I would agree that it is a probably unique
feature for C like languages, and hence people will perhaps make
mistakes with it until it becomes familiar, expected, and passe.
More information about the Digitalmars-d
mailing list