Plot2kill 0.2
Nick Sabalausky
a at a.a
Sat Mar 5 17:37:12 PST 2011
"Nick Sabalausky" <a at a.a> wrote in message
news:ikuome$2edr$1 at digitalmars.com...
> "Michel Fortin" <michel.fortin at michelf.com> wrote in message
> news:ikum9a$2agj$1 at digitalmars.com...
>> On 2011-03-05 18:42:26 -0500, dsimcha <dsimcha at yahoo.com> said:
>>
>>> This is an extreme corner case, especially if a one-way semantic
>>> @property syntax is available to work around it. The percentage of
>>> functions that return callables is very small, and of these the
>>> percentage that would forget @property is probably very small. I'd
>>> rather bug-proneness in a ridiculous corner case than breaking tons of
>>> existing code code and losing a nice feature in the common case.
>>
>> The percentage of functions that return a callable is very small until
>> you go to template land. I can easily make a container or a range of
>> delegates, and if someone somewhere forgot to make 'front' a property in
>> the container, in the container's range or in one of the filter range
>> layered on top of it, then writing 'front()' to call the front delegate
>> becomes unreliable. Is it a corner case? Yes. Is it ridiculous to expect
>> the language to detect rare but hard to find bugs? No. Is it worth it in
>> this case? I think so.
>>
>
> Along those lines, I'll point out that the idea of a range of delegates is
> not a stretch at all: it could make a lot of sense for a GUI API, for
> instance. The .NET windowing API handles callbacks as collections of
> delegates and I always thought that worked fairly well (and seems
> functionally equivalent to Qt's system of signals and slots, AIUI).
>
s/callbacks/events/ (Although I guess it works either way.)
More information about the Digitalmars-d-announce
mailing list