On Tue, Apr 16, 2013 at 6:40 AM, John Mija <[email protected]> wrote:
> That way (a) does not allow comment out a declaration *easily* and (b) it is
> not useful for more than 10 or 20 multiple declarations.
>
> static (
>     a = 1;
>     //b = 35;
>     c = 120;
> )
>
> so the code will always be clearer
>
> vs
>
> static a=1, /*b=35,*/ c=120;
>
> El 16/04/13 11:33, Alex Bradbury escribió:
>>
>> On 16 April 2013 11:28, John Mija <[email protected]> wrote:
>>>
>>> Since the low level libraries usually have many constants, it would be
>>> great
>>> whether multiple constants and variables could be grouped using
>>> parenthesis.
>>>
>>> Now:
>>>
>>> static a = 1;
>>> static b = 35;
>>> static c = 120;
>>>
>>> Using parenthesis:
>>>
>>> static (
>>>      a = 1;
>>>      b = 35;
>>>      c = 120;
>>> )
>>
>>
>> Wouldn't `static a=1, b=35, c=120;` make more sense and match `let
>> a=1, b=25, c=120;'?
>>
>> Alex

It would be simpler and clearer to just have `let x = 5;` and `static
x: int = 5`. Adding special cases to the syntax makes it more complex,
so the question is whether the added sugar outweighs the complexity.

In this case, I have a strong opinion that the simple `let pattern =
expression;` syntax is more than enough. I don't think the
comma-separated syntax should exist at all when there's already `let
(x, y) = (a, b);`.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to