Removing the space in `a+ +b`?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Removing the space in `a+ +b`?

Isiah Meadows-2
Currently, the production `a+ +b` requires a space to disambiguate it from the increment operator. However, `a++b` is not itself valid, as the postfix increment cannot be immediately followed by a bare identifier on the same line, nor can a prefix operator be preceded by one on the same line. Could the grammar be amended to include this production and make it evaluate equivalently to `a+ +b`

AdditionExpression :: AdditionExpression `++` [no LineTerminator here] UnaryExpression
--

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Removing the space in `a+ +b`?

Adam Eisenreich
Why would you need it, there should not be need to type the second + as if the first is number it will be added anyway.

---------- Původní zpráva ----------
Od: Isiah Meadows
Datum: 28. 6. 2019 v 17:44:35
Předmět: Removing the space in `a+ +b`?

Currently, the production `a+ +b` requires a space to disambiguate it from the increment operator. However, `a++b` is not itself valid, as the postfix increment cannot be immediately followed by a bare identifier on the same line, nor can a prefix operator be preceded by one on the same line. Could the grammar be amended to include this production and make it evaluate equivalently to `a+ +b`

AdditionExpression :: AdditionExpression `++` [no LineTerminator here] UnaryExpression
--


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Removing the space in `a+ +b`?

Claude Pache
In reply to this post by Isiah Meadows-2

Le 28 juin 2019 à 17:41, Isiah Meadows <[hidden email]> a écrit :

Currently, the production `a+ +b` requires a space to disambiguate it from the increment operator. However, `a++b` is not itself valid, as the postfix increment cannot be immediately followed by a bare identifier on the same line, nor can a prefix operator be preceded by one on the same line. Could the grammar be amended to include this production and make it evaluate equivalently to `a+ +b`

AdditionExpression :: AdditionExpression `++` [no LineTerminator here] UnaryExpression
--
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


What is the motivation (apart obfuscation contests, as in: `a++++b`)?

—Claude

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Removing the space in `a+ +b`?

guest271314
In reply to this post by Isiah Meadows-2
Reversing the order does not require a space character

```
+b+a
```

On Fri, Jun 28, 2019 at 3:42 PM Isiah Meadows <[hidden email]> wrote:
Currently, the production `a+ +b` requires a space to disambiguate it from the increment operator. However, `a++b` is not itself valid, as the postfix increment cannot be immediately followed by a bare identifier on the same line, nor can a prefix operator be preceded by one on the same line. Could the grammar be amended to include this production and make it evaluate equivalently to `a+ +b`

AdditionExpression :: AdditionExpression `++` [no LineTerminator here] UnaryExpression
--
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Removing the space in `a+ +b`?

Claude Pache


> Le 28 juin 2019 à 19:03, guest271314 <[hidden email]> a écrit :
>
> Reversing the order does not require a space character
>
> ```
> +b+a
> ```

If you have `+a + +b`, reversing order is not interesting.

But more importantly, there is no point into searching for a solution unless there is a problem. What is the problem with that space?

—Claude
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Removing the space in `a+ +b`?

guest271314
> But more importantly, there is no point into searching for a solution unless there is a problem. What is the problem with that space?

Agree. The only applicable context which can fathom where the existence of a space character or not in source code would be golf.

On Fri, Jun 28, 2019 at 5:38 PM Claude Pache <[hidden email]> wrote:


> Le 28 juin 2019 à 19:03, guest271314 <[hidden email]> a écrit :
>
> Reversing the order does not require a space character
>
> ```
> +b+a
> ```

If you have `+a + +b`, reversing order is not interesting.

But more importantly, there is no point into searching for a solution unless there is a problem. What is the problem with that space?

—Claude

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Removing the space in `a+ +b`?

Bob Myers
Personally I would reserve the `a ++ b` pattern for some future semantics for an infix version of the `++` operator, if anyone ever comes up with one.

On Fri, Jun 28, 2019 at 12:37 PM guest271314 <[hidden email]> wrote:
> But more importantly, there is no point into searching for a solution unless there is a problem. What is the problem with that space?

Agree. The only applicable context which can fathom where the existence of a space character or not in source code would be golf.

On Fri, Jun 28, 2019 at 5:38 PM Claude Pache <[hidden email]> wrote:


> Le 28 juin 2019 à 19:03, guest271314 <[hidden email]> a écrit :
>
> Reversing the order does not require a space character
>
> ```
> +b+a
> ```

If you have `+a + +b`, reversing order is not interesting.

But more importantly, there is no point into searching for a solution unless there is a problem. What is the problem with that space?

—Claude
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Removing the space in `a+ +b`?

Waldemar Horwat
In reply to this post by Isiah Meadows-2
On 6/28/19 8:41 AM, Isiah Meadows wrote:
> Currently, the production `a+ +b` requires a space to disambiguate it from the increment operator. However, `a++b` is not itself valid, as the postfix increment cannot be immediately followed by a bare identifier on the same line, nor can a prefix operator be preceded by one on the same line. Could the grammar be amended to include this production and make it evaluate equivalently to `a+ +b`
>
> AdditionExpression :: AdditionExpression `++` [no LineTerminator here] UnaryExpression

Maybe it could, but the extra complexity really doesn't seem worth it, particularly since you'd need the unusual line terminator restriction to avoid breaking existing code.  Other uses of + don't have line terminator restrictions.

     Waldemar
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Removing the space in `a+ +b`?

Isiah Meadows-2
Just an update to you all: I'm only very weakly for this, and I'm okay
to rescind this suggestion.

-----

Isiah Meadows
[hidden email]
www.isiahmeadows.com

On Fri, Jun 28, 2019 at 5:01 PM Waldemar Horwat <[hidden email]> wrote:
>
> On 6/28/19 8:41 AM, Isiah Meadows wrote:
> > Currently, the production `a+ +b` requires a space to disambiguate it from the increment operator. However, `a++b` is not itself valid, as the postfix increment cannot be immediately followed by a bare identifier on the same line, nor can a prefix operator be preceded by one on the same line. Could the grammar be amended to include this production and make it evaluate equivalently to `a+ +b`
> >
> > AdditionExpression :: AdditionExpression `++` [no LineTerminator here] UnaryExpression
>
> Maybe it could, but the extra complexity really doesn't seem worth it, particularly since you'd need the unusual line terminator restriction to avoid breaking existing code.  Other uses of + don't have line terminator restrictions.
>
>      Waldemar
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss