Proposal: struct and array literal syntax

Chris Miller chris at dprogramming.com
Sat Jun 24 15:14:32 PDT 2006


On Sat, 24 Jun 2006 17:33:59 -0400, Andrei Khropov  
<andkhropov at nospam_mtu-net.ru> wrote:

> Daniel Keep wrote:
>
>> > All this talk makes kinda wish that the ascii tables (and  
>> consequently  the
>> > standard keyboards as well) had one more set of brackets, like the   
>> angle
>> > brackets for example
>> >  
>> (http://en.wikipedia.org/wiki/Bracket#Angle_brackets_or_chevrons_.E2.8C.A9.C
>> > 2.A0.E2.8C.AA),  used for tuple notation in math. "〈1, 2〉"
>> >
>> > A comparison:
>> >
>> > <1, 2>
>> > ‹1, 2›
>> > «1, 2»
>> > 〈1, 2〉 // Why do these take two spaces?
>> > 《1, 2》
>> >
>>
>> AFAIK, they take spaces because they are "fullwidth" asian characters. I
>> think it comes from most western glyphs being vertical rectangles, and  
>> most
>> asian glyphs being square-ish.  So they make the characters twice as  
>> wide :)
>>
>> As for more brackets: hell yeah.  I think there are three things that  
>> really
>> limit programming languages: lack of special characters that will  
>> reliably be
>> on many computers, lack of special characters on our keyboards, and
>> programming language's fixation on using special characters :P
>>
>> I think that what would help is adding these features with whatever  
>> syntax we
>> can muster, and add alises for these using extended characters where we  
>> can
>> find them.
>>
>> Maybe if we start supporting more than basic ASCII now, someday we'll  
>> get
>> better keyboards :)
>
> Well, I think Unicode is not the problem.
> The biggest problem is our limited keyboards really.
> I have made a little inspection and found that some symbols (`,\,@,#,№)  
> are
> unused in D yet. Maybe put 'em to some use? :-)
>
> P.S. And, yeah, I want tuples in D and lists too.
>

` is for wysiwyg string literals; \ is for escaped string literals; @ is  
unused; # is for special token sequences; and I don't know about № - it's  
not on my keyboard.



More information about the Digitalmars-d mailing list