A different tuple syntax

dennis luehring dl.soluz at gmx.net
Thu May 30 07:37:24 PDT 2013


Am 30.05.2013 16:26, schrieb watcher:
> On Thursday, 30 May 2013 at 14:06:15 UTC, Diggory wrote:
>> Could also do something in the style of token strings, ie.
>>
>> t{ ... }
>>
>> It's lighter than "tup" and there's a precedent for it already
>> in the language with q{ ... } which also means there should be
>> no issues parsing it.
>
> These are the hacks that bring languages into a kind of brainfuck
> syntax. Why not keep a language easy readable and understandable.
> A precedence does not imply that it is a desirable thing to have.
>

then is the only solution to free tuple/or use tup with {}

this way a tuple is similar from a syntax perspective like class or 
struct - the {} scope defines the interface of the tuple which are by 
default unnamed ordered aliases for type/value

class { int a; int b; ... }
tuple { int, double, "hello" }

its easy to parse, context free and doesn't need a new type of scope




More information about the Digitalmars-d mailing list