shouting versus dotting

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Oct 5 11:19:26 PDT 2008


Ary Borenszweig wrote:
> Andrei Alexandrescu escribió:
>> KennyTM~ wrote:
>>> Andrei Alexandrescu wrote:
>>>> Michel Fortin wrote:
>>>>> On 2008-10-05 01:14:17 -0400, Andrei Alexandrescu 
>>>>> <SeeWebsiteForEmail at erdani.org> said:
>>>>>
>>>>> -- snip --
>>>>>
>>>>> Or we could use special delimiter characters:
>>>>>
>>>>>     Positive<real>(joke);
>>>>>     Positive“real”(joke);
>>>>>     Positive«real»(joke);
>>>>>     Positive#real@(joke);
>>>>>
>>>>> Each having its own problem though.
>>>>>
>>>>> My preference still goes to "!(".
>>>>
>>>> There was also Positive{real}(joke), with which I couldn't find an 
>>>> ambiguity.
>>>  >
>>>
>>> Ohhhh. Why isn't it considered then? (Suppose we already knew 
>>> Positive is not a keyword and not preceded by the keywords struct, 
>>> class, etc.)
>>
>> I believe it should be considered. At some point there was discussion 
>> on accepting a last parameter of delegate type outside the function 
>> parens. The idea was to allow user-defined code to define constructs 
>> similar to e.g. if and foreach.
>>
>> But I think that has many other problems (one of which is that the 
>> delegate can't reasonably specify parameters), so we can safely 
>> discount that as a problem.
>>
>> I'd want to give it a try. How do others feel about Template{arguments}?
> 
> I thought no one read my post, now I see you are discussing it in 
> another thread. :-P
> 
> After I posted, I also remembered the possibility of allowing delegate 
> invocation in a nicer way, and that conflicts with Foo{T}. :-(

I think we can drop that. Even if we allow that, there will be parens 
needed before the delegate body, at least for passing it arguments.

Andrei



More information about the Digitalmars-d mailing list