lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I don't really like the unary negation in
> http://moonscript.org/reference/#considerations because there's always people
> that will write it either x-y or x - y ...

I understand that this can be confusing. I am thinking of adding a
case where if the - follows a variable name with no whitespace then it
will treat it as subtraction instead of a function call. This means
that parenthesis-less invocation must be done with a space.

> Wouldn't this already be solved by doing x(-10) (or x(- 10) or x( -10 ) or
> x( - 10 ) in moonscript?

I don't follow. This syntax is already supported, and you can do it to
avoid ambiguity when calling a function.

> - Same for strings as first argument. I think this is too special of a case of
>  making a problem of to solve because it doesn't even apply to second to n'th
>  arguments. I'd much prefer requiring a space just as with non string
>  arguments.

This I don't want to get rid of because I am really used to doing it
in Lua. It makes things like LPeg grammars look a lot neater because
there aren't parentheses everywhere.

On Sat, Aug 13, 2011 at 12:49 PM, Tom <tom.wieland@gmail.com> wrote:
> Here's my thoughts from reading the reference;
> - I don't really like the unary negation in
>  http://moonscript.org/reference/#considerations because there's always people
>  that will write it either x-y or x - y and while I don't object with using
>  whitespace and line endings as a part of the control flow I think this is
>  just like something silly like not allowing x( y ) and enforcing x(y).
>  Wouldn't this already be solved by doing x(-10) (or x(- 10) or x( -10 ) or
>  x( - 10 ) in moonscript?
> - Same for strings as first argument. I think this is too special of a case of
>  making a problem of to solve because it doesn't even apply to second to n'th
>  arguments. I'd much prefer requiring a space just as with non string
>  arguments.
> - a\b! --> a:b() doesn't feel 'natural'. b doesn't seem 'connected' to a. Guess
>  this feeling will pass when I've used moonscript for a while.
>
> 2011/8/13 Pierre-Yves Gérardy <pygy79@gmail.com>:
>> 2011/8/13 Pierre-Yves Gérardy <pygy79@gmail.com>:
>>> * In tables, make the square brackets optional for string literals (I
>>> think it is unambiguous).
>> I meant in table keys.
>>
>> -- Pierre-Yves
>>
>>
>
>