anole-lang / anole

The Anole Programming Language
MIT License
17 stars 1 forks source link

[FEATURE] Improve declaration statement #50

Closed mu001999 closed 3 years ago

mu001999 commented 3 years ago

Like the followings:

@a: 1;
@b, c: 1, 2;
@(d, e), f: (1, 2), 3;
mu001999 commented 3 years ago

Use @[a, b], c: [1, 2], 3; instead of @(a, b), c: (1, 2), 3; to differ from the lambda expression @(...): ...

mu001999 commented 3 years ago
// correct:
@a, b: 1, 2;     // positional
@a, b: [1, 2];   // unpack
@[a, b]: [1, 2]; // unpack

// wrong:  
@[a, b]: 1, 2;