shouting versus dotting

KennyTM~ kennytm at gmail.com
Sun Oct 5 10:43:06 PDT 2008


Gregor Richards wrote:
> KennyTM~ wrote:
>> Michel Fortin wrote:
>>> On 2008-10-05 01:14:17 -0400, Andrei Alexandrescu 
>>> <SeeWebsiteForEmail at erdani.org> said:
>>>
>>>> I don't favor "." any more than the next guy, but I am glad there is 
>>>> awareness of how unfit a choice "!" is. If you have any ideas, 
>>>> please post them! Ah! I! Exclaimed! Again!
>>>
>>> Hum, I don't think we have much choice, it'll have to be something in 
>>> this lot:
>>>
>>>     Positive!(real)(joke);
>>>     Positive.(real)(joke);
>>>     Positive#(real)(joke);
>>>     Positive@(real)(joke);
>>>     Positive&(real)(joke);
>>>     Positive`(real)(joke);
>>>     Positive´(real)(joke);
>>>     Positive^(real)(joke);
>>>     Positive¨(real)(joke);
>>>     Positive\(real)(joke);
>>>
>>> Anything else I forgot?
>>>
>>> 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 "!(".
>>>
>>> - - -
>>>
>>> The ".(" syntax makes me think more of something like this:
>>>
>>>     void func(T, alias methodOfT, A...)(T obj, A args)
>>>     {
>>>         obj.(methodOfT)(args);
>>>     }
>>>
>>> which I which I could do. If methodOfT was a string, I suppose I 
>>> could use string mixins, but it pushes diagnostics about misnamed 
>>> methods further in the template and requires adding quotes to the 
>>> template parameter when instanciating.
>>>
>>
>> Argh, actually I once have a strong desire making
>>
>>   f«T»(x);
>>
>> a valid construct, and to workaround that « and » can't be easily 
>> typed you could substitute it with
>>
>>   f\<T\>(x);
> 
> Yes. Trigraphs were such a good idea in C, let's bring them to D X_X
> 
>  - Gregor Richards

It has been done with Pascal ( {comment} = (*comment*) } already. And 
the \ character is used to escape stuffs already, so no problem like 
writing "what??!" in C. And technically it's just a digraph, so at most 
it is only 67% as evil as trigraphs <g>.

OK I'm just joking :p.



More information about the Digitalmars-d mailing list