foo!(bar) ==> foo{bar}

Don nospam at nospam.com.au
Thu Oct 9 00:19:42 PDT 2008


Andrei Alexandrescu wrote:
> Tomas Lindquist Olsen wrote:
>> Walter Bright wrote:
>>> Tomas Lindquist Olsen wrote:
>>>> I just think it's funny that this has even come up and is getting 
>>>> serious consideration. Walter usually don't like changing the color 
>>>> of his shed! And D coders are already used to !()
>>>
>>> As Andrei said, I don't write a lot of templates. He does.
>>>
>>> What I'd really like are those funky « and » quote characters. But 
>>> alas, few keyboards have them on it. (I inserted them here by cutting 
>>> and pasting from somewhere else, hardly very practical. I could 
>>> modify my text editor to make it easy, but what about every other 
>>> ascii text editor people use?)
>>
>> They're not printed on my keyboard but I can use AltGr+Z and AltGr+X 
>> to produce « and » . This is actually a lot nicer to type than { } 
>> which requires me to move my hands a lot more.
>>
>> I think it's a real problem if some people can't produce them 
>> though... Sometimes you just wanna hack a bit in some crappy console 
>> editor...
> 
> I think we can discount the chevrons as an input method. From what I see 
> the display devices and fonts are well-prepared, but ASCII still rules 
> on the good old keyboard.

I think the importance of € is a sign that the days of ASCII are 
numbered. (And the current US situation doesn't lead me to believe that 
the euro is about to decrease in importance <g>).
You just can't make an editor without support for UTF any more.

> I agree with Dave that allowing two syntaxes raises a brow. There are 
> two counter-arguments to take into consideration. One is, there is a 
> growing trend of improving code visuals across programming language and 
> editors (syntax coloring, code folding, paren highlighting, various 
> autocompletions and electric modes, error highlighting...), and to me it 
> looks like transforming Foo!( into Foo«» upon typing is just a shade in 
> that continuum. The second is that Walter mentioned repeatedly how neat 
> it would be if certain math Unicode symbols could be used as infix 
> operations. Experimenting a bit with Unicode symbols may be a pretty 
> interesting activity.

Since there are already many people using chinese characters as variable 
names in D code, it makes a fair bit of sense.



More information about the Digitalmars-d mailing list