"Nick Sabalausky" <[email protected]> wrote in message 
news:[email protected]...
> "Michel Fortin" <[email protected]> wrote in message 
> news:[email protected]...
>> On 2011-03-05 18:42:26 -0500, dsimcha <[email protected]> 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.)


Reply via email to