Partial Expression proposal

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

Partial Expression proposal

Tamás Halasi
It's like the functional application proposal, just for any expression. It would improve
See the proposal: https://github.com/trustedtomato/proposal-partial-expression

What are your thoughts?

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

Re: Partial Expression proposal

Mike Samuel
On Wed, Dec 27, 2017 at 1:43 PM, Tamás Halasi <[hidden email]> wrote:
> It's like the functional application proposal, just for any expression. It
> would improve

This sentence ends abruptly.  What would this proposal improve?

> See the proposal:
> https://github.com/trustedtomato/proposal-partial-expression
>
> What are your thoughts?

Is this lambdas with De Bruijn indices?

The proposal says
"""The ? token is used in conditional expressions, but its not
ambiguous, because in this proposal, a ? cannot follow an expression,
while in a conditional expression it always does."""

You have ?? and ??? for referring to outer layers.  Is there no ambiguity there?

  ? ? ? : ?

may not be ambiguous, but without the spaces it would require
lookahead to the ":" to resolve ambiguity,
unless the tokenizer starts to consume maximal runs of question marks.



> _______________________________________________
> 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: Partial Expression proposal

Tamás Halasi
> This sentence ends abruptly.  What would this proposal improve?

Oops, I accidentally pressed Send...
So, it would improve functional programming in general, the examples are in the README.

> Is this lambdas with De Bruijn indices?

Hmm, I haven't heard of them yet, but by looking at the surface, they seems to be similar.

> You have ?? and ??? for referring to outer layers.  Is there no ambiguity there?

That's a very good point! I haven't thought of that. I can't think of a solution, the lookahead is indeed very bad. I opened an issue. I think the notation (for accessing arguments from outer layers) will have to be changed / removed.

Thanks for the feedback! :)

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

Re: Partial Expression proposal

Isiah Meadows-2
My concern: I get the concept, and could see how at the first level
(e.g. `#? + ?`) it could be useful, but I can tell you that this
doesn't look especially obvious, and starts to look almost like the
line noise of some Perl or APL [1]/J [2]/etc.:

```
// Example 1:
let foo = #foo(#???:??)

// Example 2:
let constant = ##??

// Example 3:
let makeAdder = ##?+??
```

And I agree with Mike in that it does remind me of De Bruijn indices.
Those are nice in binary encodings, but they tend to start looking
like line noise after sufficient depth. (An entire esoteric language
has been formed based on this whole thing: Binary Lambda Calculus
[3].)

Oh, and this will most *certainly* conflict with the stage 3 private
property proposal:

```js
let bar = () => console.log("outer")
class Foo {
    #bar = () => console.log("inner")

    method() {
        // Should this return a thunk or log "inner"?
        list.map(##bar(1, 2, ?))
    }
}
```

[1]: https://en.wikipedia.org/wiki/APL_(programming_language)
[2]: https://en.wikipedia.org/wiki/J_(programming_language)
[3]: http://web.archive.org/web/20161019165606/https://en.wikipedia.org/wiki/Binary_lambda_calculus

-----

Isiah Meadows
[hidden email]

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Wed, Dec 27, 2017 at 2:55 PM, Tamás Halasi <[hidden email]> wrote:

>> This sentence ends abruptly.  What would this proposal improve?
>
> Oops, I accidentally pressed Send...
> So, it would improve functional programming in general, the examples are in
> the README.
>
>> Is this lambdas with De Bruijn indices?
>
> Hmm, I haven't heard of them yet, but by looking at the surface, they seems
> to be similar.
>
>> You have ?? and ??? for referring to outer layers.  Is there no ambiguity
>> there?
>
> That's a very good point! I haven't thought of that. I can't think of a
> solution, the lookahead is indeed very bad. I opened an issue. I think the
> notation (for accessing arguments from outer layers) will have to be changed
> / removed.
>
> Thanks for the feedback! :)
>
> _______________________________________________
> 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: Partial Expression proposal

Tamás Halasi
Hmm I see. I'll definitely remove the multiple ? marks and keep it one level.
And change the # to something else... For example, §.
With these changes, is there anything which should be changed?

2017-12-27 21:17 GMT+01:00 Isiah Meadows <[hidden email]>:
My concern: I get the concept, and could see how at the first level
(e.g. `#? + ?`) it could be useful, but I can tell you that this
doesn't look especially obvious, and starts to look almost like the
line noise of some Perl or APL [1]/J [2]/etc.:

```
// Example 1:
let foo = #foo(#???:??)

// Example 2:
let constant = ##??

// Example 3:
let makeAdder = ##?+??
```

And I agree with Mike in that it does remind me of De Bruijn indices.
Those are nice in binary encodings, but they tend to start looking
like line noise after sufficient depth. (An entire esoteric language
has been formed based on this whole thing: Binary Lambda Calculus
[3].)

Oh, and this will most *certainly* conflict with the stage 3 private
property proposal:

```js
let bar = () => console.log("outer")
class Foo {
    #bar = () => console.log("inner")

    method() {
        // Should this return a thunk or log "inner"?
        list.map(##bar(1, 2, ?))
    }
}
```

[1]: https://en.wikipedia.org/wiki/APL_(programming_language)
[2]: https://en.wikipedia.org/wiki/J_(programming_language)
[3]: http://web.archive.org/web/20161019165606/https://en.wikipedia.org/wiki/Binary_lambda_calculus

-----

Isiah Meadows
[hidden email]

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Wed, Dec 27, 2017 at 2:55 PM, Tamás Halasi <[hidden email]> wrote:
>> This sentence ends abruptly.  What would this proposal improve?
>
> Oops, I accidentally pressed Send...
> So, it would improve functional programming in general, the examples are in
> the README.
>
>> Is this lambdas with De Bruijn indices?
>
> Hmm, I haven't heard of them yet, but by looking at the surface, they seems
> to be similar.
>
>> You have ?? and ??? for referring to outer layers.  Is there no ambiguity
>> there?
>
> That's a very good point! I haven't thought of that. I can't think of a
> solution, the lookahead is indeed very bad. I opened an issue. I think the
> notation (for accessing arguments from outer layers) will have to be changed
> / removed.
>
> Thanks for the feedback! :)
>
> _______________________________________________
> 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: Partial Expression proposal

Sebastian Cholewa
On PC writing “§” character wouldn’t be convenient, as it’s not on  
keyboard. One would has to copy and paste it. I see this as problematic.  
Writing code should not require any extra acrobatics with set of  
characters.

To be more constructive, available characters are:  
!@#$%^&*()_+-=[]{};:'",<.>/?

W dniu .12.2017 o 21:56 Tamás Halasi <[hidden email]> pisze:

> Hmm I see. I'll definitely remove the multiple ? marks and keep it one
> level.
> And change the # to something else... For example, §.
> With these changes, is there anything which should be changed?
>
> 2017-12-27 21:17 GMT+01:00 Isiah Meadows <[hidden email]>:
>
>> My concern: I get the concept, and could see how at the first level
>> (e.g. `#? + ?`) it could be useful, but I can tell you that this
>> doesn't look especially obvious, and starts to look almost like the
>> line noise of some Perl or APL [1]/J [2]/etc.:
>>
>> ```
>> // Example 1:
>> let foo = #foo(#???:??)
>>
>> // Example 2:
>> let constant = ##??
>>
>> // Example 3:
>> let makeAdder = ##?+??
>> ```
>>
>> And I agree with Mike in that it does remind me of De Bruijn indices.
>> Those are nice in binary encodings, but they tend to start looking
>> like line noise after sufficient depth. (An entire esoteric language
>> has been formed based on this whole thing: Binary Lambda Calculus
>> [3].)
>>
>> Oh, and this will most *certainly* conflict with the stage 3 private
>> property proposal:
>>
>> ```js
>> let bar = () => console.log("outer")
>> class Foo {
>>     #bar = () => console.log("inner")
>>
>>     method() {
>>         // Should this return a thunk or log "inner"?
>>         list.map(##bar(1, 2, ?))
>>     }
>> }
>> ```
>>
>> [1]: https://en.wikipedia.org/wiki/APL_(programming_language)
>> [2]: https://en.wikipedia.org/wiki/J_(programming_language)
>> [3]: http://web.archive.org/web/20161019165606/https://en.
>> wikipedia.org/wiki/Binary_lambda_calculus
>>
>> -----
>>
>> Isiah Meadows
>> [hidden email]
>>
>> Looking for web consulting? Or a new website?
>> Send me an email and we can get started.
>> www.isiahmeadows.com
>>
>>
>> On Wed, Dec 27, 2017 at 2:55 PM, Tamás Halasi <[hidden email]>
>> wrote:
>> >> This sentence ends abruptly.  What would this proposal improve?
>> >
>> > Oops, I accidentally pressed Send...
>> > So, it would improve functional programming in general, the examples  
>> are
>> in
>> > the README.
>> >
>> >> Is this lambdas with De Bruijn indices?
>> >
>> > Hmm, I haven't heard of them yet, but by looking at the surface, they
>> seems
>> > to be similar.
>> >
>> >> You have ?? and ??? for referring to outer layers.  Is there no
>> ambiguity
>> >> there?
>> >
>> > That's a very good point! I haven't thought of that. I can't think of  
>> a
>> > solution, the lookahead is indeed very bad. I opened an issue. I think
>> the
>> > notation (for accessing arguments from outer layers) will have to be
>> changed
>> > / removed.
>> >
>> > Thanks for the feedback! :)
>> >
>> > _______________________________________________
>> > 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: Partial Expression proposal

Alexander Jones
The real JavaScript 'character wall'.

On 27 December 2017 at 21:30, Sebastian Cholewa <[hidden email]> wrote:
On PC writing “§” character wouldn’t be convenient, as it’s not on keyboard. One would has to copy and paste it. I see this as problematic. Writing code should not require any extra acrobatics with set of characters.

To be more constructive, available characters are: !@#$%^&*()_+-=[]{};:'",<.>/?

W dniu .12.2017 o 21:56 Tamás Halasi <[hidden email]> pisze:


Hmm I see. I'll definitely remove the multiple ? marks and keep it one
level.
And change the # to something else... For example, §.
With these changes, is there anything which should be changed?

2017-12-27 21:17 GMT+01:00 Isiah Meadows <[hidden email]>:

My concern: I get the concept, and could see how at the first level
(e.g. `#? + ?`) it could be useful, but I can tell you that this
doesn't look especially obvious, and starts to look almost like the
line noise of some Perl or APL [1]/J [2]/etc.:

```
// Example 1:
let foo = #foo(#???:??)

// Example 2:
let constant = ##??

// Example 3:
let makeAdder = ##?+??
```

And I agree with Mike in that it does remind me of De Bruijn indices.
Those are nice in binary encodings, but they tend to start looking
like line noise after sufficient depth. (An entire esoteric language
has been formed based on this whole thing: Binary Lambda Calculus
[3].)

Oh, and this will most *certainly* conflict with the stage 3 private
property proposal:

```js
let bar = () => console.log("outer")
class Foo {
    #bar = () => console.log("inner")

    method() {
        // Should this return a thunk or log "inner"?
        list.map(##bar(1, 2, ?))
    }
}
```

[1]: https://en.wikipedia.org/wiki/APL_(programming_language)
[2]: https://en.wikipedia.org/wiki/J_(programming_language)
[3]: http://web.archive.org/web/20161019165606/https://en.
wikipedia.org/wiki/Binary_lambda_calculus

-----

Isiah Meadows
[hidden email]

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Wed, Dec 27, 2017 at 2:55 PM, Tamás Halasi <[hidden email]>
wrote:
>> This sentence ends abruptly.  What would this proposal improve?
>
> Oops, I accidentally pressed Send...
> So, it would improve functional programming in general, the examples are
in
> the README.
>
>> Is this lambdas with De Bruijn indices?
>
> Hmm, I haven't heard of them yet, but by looking at the surface, they
seems
> to be similar.
>
>> You have ?? and ??? for referring to outer layers.  Is there no
ambiguity
>> there?
>
> That's a very good point! I haven't thought of that. I can't think of a
> solution, the lookahead is indeed very bad. I opened an issue. I think
the
> notation (for accessing arguments from outer layers) will have to be
changed
> / removed.
>
> Thanks for the feedback! :)
>
> _______________________________________________
> 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


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

Re: Partial Expression proposal

Tamás Halasi
Do you think \ would be a good replacement for #?
It is currently illegal outside string literals as far as I know.

2017-12-28 1:23 GMT+01:00 Alexander Jones <[hidden email]>:
The real JavaScript 'character wall'.

On 27 December 2017 at 21:30, Sebastian Cholewa <[hidden email]> wrote:
On PC writing “§” character wouldn’t be convenient, as it’s not on keyboard. One would has to copy and paste it. I see this as problematic. Writing code should not require any extra acrobatics with set of characters.

To be more constructive, available characters are: !@#$%^&*()_+-=[]{};:'",<.>/?

W dniu .12.2017 o 21:56 Tamás Halasi <[hidden email]> pisze:


Hmm I see. I'll definitely remove the multiple ? marks and keep it one
level.
And change the # to something else... For example, §.
With these changes, is there anything which should be changed?

2017-12-27 21:17 GMT+01:00 Isiah Meadows <[hidden email]>:

My concern: I get the concept, and could see how at the first level
(e.g. `#? + ?`) it could be useful, but I can tell you that this
doesn't look especially obvious, and starts to look almost like the
line noise of some Perl or APL [1]/J [2]/etc.:

```
// Example 1:
let foo = #foo(#???:??)

// Example 2:
let constant = ##??

// Example 3:
let makeAdder = ##?+??
```

And I agree with Mike in that it does remind me of De Bruijn indices.
Those are nice in binary encodings, but they tend to start looking
like line noise after sufficient depth. (An entire esoteric language
has been formed based on this whole thing: Binary Lambda Calculus
[3].)

Oh, and this will most *certainly* conflict with the stage 3 private
property proposal:

```js
let bar = () => console.log("outer")
class Foo {
    #bar = () => console.log("inner")

    method() {
        // Should this return a thunk or log "inner"?
        list.map(##bar(1, 2, ?))
    }
}
```

[1]: https://en.wikipedia.org/wiki/APL_(programming_language)
[2]: https://en.wikipedia.org/wiki/J_(programming_language)
[3]: http://web.archive.org/web/20161019165606/https://en.
wikipedia.org/wiki/Binary_lambda_calculus

-----

Isiah Meadows
[hidden email]

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Wed, Dec 27, 2017 at 2:55 PM, Tamás Halasi <[hidden email]>
wrote:
>> This sentence ends abruptly.  What would this proposal improve?
>
> Oops, I accidentally pressed Send...
> So, it would improve functional programming in general, the examples are
in
> the README.
>
>> Is this lambdas with De Bruijn indices?
>
> Hmm, I haven't heard of them yet, but by looking at the surface, they
seems
> to be similar.
>
>> You have ?? and ??? for referring to outer layers.  Is there no
ambiguity
>> there?
>
> That's a very good point! I haven't thought of that. I can't think of a
> solution, the lookahead is indeed very bad. I opened an issue. I think
the
> notation (for accessing arguments from outer layers) will have to be
changed
> / removed.
>
> Thanks for the feedback! :)
>
> _______________________________________________
> 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



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

Re: Partial Expression proposal

Isiah Meadows-2
Except it's not. The identifier `foo\u0048` is equivalent to `fooA`,
for example.
-----

Isiah Meadows
[hidden email]

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Thu, Dec 28, 2017 at 6:56 AM, Tamás Halasi <[hidden email]> wrote:

> Do you think \ would be a good replacement for #?
> It is currently illegal outside string literals as far as I know.
>
> 2017-12-28 1:23 GMT+01:00 Alexander Jones <[hidden email]>:
>>
>> The real JavaScript 'character wall'.
>>
>> On 27 December 2017 at 21:30, Sebastian Cholewa
>> <[hidden email]> wrote:
>>>
>>> On PC writing “§” character wouldn’t be convenient, as it’s not on
>>> keyboard. One would has to copy and paste it. I see this as problematic.
>>> Writing code should not require any extra acrobatics with set of characters.
>>>
>>> To be more constructive, available characters are:
>>> !@#$%^&*()_+-=[]{};:'",<.>/?
>>>
>>> W dniu .12.2017 o 21:56 Tamás Halasi <[hidden email]> pisze:
>>>
>>>
>>>> Hmm I see. I'll definitely remove the multiple ? marks and keep it one
>>>> level.
>>>> And change the # to something else... For example, §.
>>>> With these changes, is there anything which should be changed?
>>>>
>>>> 2017-12-27 21:17 GMT+01:00 Isiah Meadows <[hidden email]>:
>>>>
>>>>> My concern: I get the concept, and could see how at the first level
>>>>> (e.g. `#? + ?`) it could be useful, but I can tell you that this
>>>>> doesn't look especially obvious, and starts to look almost like the
>>>>> line noise of some Perl or APL [1]/J [2]/etc.:
>>>>>
>>>>> ```
>>>>> // Example 1:
>>>>> let foo = #foo(#???:??)
>>>>>
>>>>> // Example 2:
>>>>> let constant = ##??
>>>>>
>>>>> // Example 3:
>>>>> let makeAdder = ##?+??
>>>>> ```
>>>>>
>>>>> And I agree with Mike in that it does remind me of De Bruijn indices.
>>>>> Those are nice in binary encodings, but they tend to start looking
>>>>> like line noise after sufficient depth. (An entire esoteric language
>>>>> has been formed based on this whole thing: Binary Lambda Calculus
>>>>> [3].)
>>>>>
>>>>> Oh, and this will most *certainly* conflict with the stage 3 private
>>>>> property proposal:
>>>>>
>>>>> ```js
>>>>> let bar = () => console.log("outer")
>>>>> class Foo {
>>>>>     #bar = () => console.log("inner")
>>>>>
>>>>>     method() {
>>>>>         // Should this return a thunk or log "inner"?
>>>>>         list.map(##bar(1, 2, ?))
>>>>>     }
>>>>> }
>>>>> ```
>>>>>
>>>>> [1]: https://en.wikipedia.org/wiki/APL_(programming_language)
>>>>> [2]: https://en.wikipedia.org/wiki/J_(programming_language)
>>>>> [3]: http://web.archive.org/web/20161019165606/https://en.
>>>>> wikipedia.org/wiki/Binary_lambda_calculus
>>>>>
>>>>> -----
>>>>>
>>>>> Isiah Meadows
>>>>> [hidden email]
>>>>>
>>>>> Looking for web consulting? Or a new website?
>>>>> Send me an email and we can get started.
>>>>> www.isiahmeadows.com
>>>>>
>>>>>
>>>>> On Wed, Dec 27, 2017 at 2:55 PM, Tamás Halasi
>>>>> <[hidden email]>
>>>>> wrote:
>>>>> >> This sentence ends abruptly.  What would this proposal improve?
>>>>> >
>>>>> > Oops, I accidentally pressed Send...
>>>>> > So, it would improve functional programming in general, the examples
>>>>> > are
>>>>> in
>>>>> > the README.
>>>>> >
>>>>> >> Is this lambdas with De Bruijn indices?
>>>>> >
>>>>> > Hmm, I haven't heard of them yet, but by looking at the surface, they
>>>>> seems
>>>>> > to be similar.
>>>>> >
>>>>> >> You have ?? and ??? for referring to outer layers.  Is there no
>>>>> ambiguity
>>>>> >> there?
>>>>> >
>>>>> > That's a very good point! I haven't thought of that. I can't think of
>>>>> > a
>>>>> > solution, the lookahead is indeed very bad. I opened an issue. I
>>>>> > think
>>>>> the
>>>>> > notation (for accessing arguments from outer layers) will have to be
>>>>> changed
>>>>> > / removed.
>>>>> >
>>>>> > Thanks for the feedback! :)
>>>>> >
>>>>> > _______________________________________________
>>>>> > 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
>>
>>
>
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Partial Expression proposal

Tamás Halasi
Damn.
I wonder why is that useful.
But whatever.

What symbol do you think would be the best?
A binary operator have to have an expression at its left side, so *, /, %, >, <, &, ^ or | might be good.


2017-12-28 16:19 GMT+01:00 Isiah Meadows <[hidden email]>:
Except it's not. The identifier `foo\u0048` is equivalent to `fooA`,
for example.
-----

Isiah Meadows
[hidden email]

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Thu, Dec 28, 2017 at 6:56 AM, Tamás Halasi <[hidden email]> wrote:
> Do you think \ would be a good replacement for #?
> It is currently illegal outside string literals as far as I know.
>
> 2017-12-28 1:23 GMT+01:00 Alexander Jones <[hidden email]>:
>>
>> The real JavaScript 'character wall'.
>>
>> On 27 December 2017 at 21:30, Sebastian Cholewa
>> <[hidden email]> wrote:
>>>
>>> On PC writing “§” character wouldn’t be convenient, as it’s not on
>>> keyboard. One would has to copy and paste it. I see this as problematic.
>>> Writing code should not require any extra acrobatics with set of characters.
>>>
>>> To be more constructive, available characters are:
>>> !@#$%^&*()_+-=[]{};:'",<.>/?
>>>
>>> W dniu .12.2017 o 21:56 Tamás Halasi <[hidden email]> pisze:
>>>
>>>
>>>> Hmm I see. I'll definitely remove the multiple ? marks and keep it one
>>>> level.
>>>> And change the # to something else... For example, §.
>>>> With these changes, is there anything which should be changed?
>>>>
>>>> 2017-12-27 21:17 GMT+01:00 Isiah Meadows <[hidden email]>:
>>>>
>>>>> My concern: I get the concept, and could see how at the first level
>>>>> (e.g. `#? + ?`) it could be useful, but I can tell you that this
>>>>> doesn't look especially obvious, and starts to look almost like the
>>>>> line noise of some Perl or APL [1]/J [2]/etc.:
>>>>>
>>>>> ```
>>>>> // Example 1:
>>>>> let foo = #foo(#???:??)
>>>>>
>>>>> // Example 2:
>>>>> let constant = ##??
>>>>>
>>>>> // Example 3:
>>>>> let makeAdder = ##?+??
>>>>> ```
>>>>>
>>>>> And I agree with Mike in that it does remind me of De Bruijn indices.
>>>>> Those are nice in binary encodings, but they tend to start looking
>>>>> like line noise after sufficient depth. (An entire esoteric language
>>>>> has been formed based on this whole thing: Binary Lambda Calculus
>>>>> [3].)
>>>>>
>>>>> Oh, and this will most *certainly* conflict with the stage 3 private
>>>>> property proposal:
>>>>>
>>>>> ```js
>>>>> let bar = () => console.log("outer")
>>>>> class Foo {
>>>>>     #bar = () => console.log("inner")
>>>>>
>>>>>     method() {
>>>>>         // Should this return a thunk or log "inner"?
>>>>>         list.map(##bar(1, 2, ?))
>>>>>     }
>>>>> }
>>>>> ```
>>>>>
>>>>> [1]: https://en.wikipedia.org/wiki/APL_(programming_language)
>>>>> [2]: https://en.wikipedia.org/wiki/J_(programming_language)
>>>>> [3]: http://web.archive.org/web/20161019165606/https://en.
>>>>> wikipedia.org/wiki/Binary_lambda_calculus
>>>>>
>>>>> -----
>>>>>
>>>>> Isiah Meadows
>>>>> [hidden email]
>>>>>
>>>>> Looking for web consulting? Or a new website?
>>>>> Send me an email and we can get started.
>>>>> www.isiahmeadows.com
>>>>>
>>>>>
>>>>> On Wed, Dec 27, 2017 at 2:55 PM, Tamás Halasi
>>>>> <[hidden email]>
>>>>> wrote:
>>>>> >> This sentence ends abruptly.  What would this proposal improve?
>>>>> >
>>>>> > Oops, I accidentally pressed Send...
>>>>> > So, it would improve functional programming in general, the examples
>>>>> > are
>>>>> in
>>>>> > the README.
>>>>> >
>>>>> >> Is this lambdas with De Bruijn indices?
>>>>> >
>>>>> > Hmm, I haven't heard of them yet, but by looking at the surface, they
>>>>> seems
>>>>> > to be similar.
>>>>> >
>>>>> >> You have ?? and ??? for referring to outer layers.  Is there no
>>>>> ambiguity
>>>>> >> there?
>>>>> >
>>>>> > That's a very good point! I haven't thought of that. I can't think of
>>>>> > a
>>>>> > solution, the lookahead is indeed very bad. I opened an issue. I
>>>>> > think
>>>>> the
>>>>> > notation (for accessing arguments from outer layers) will have to be
>>>>> changed
>>>>> > / removed.
>>>>> >
>>>>> > Thanks for the feedback! :)
>>>>> >
>>>>> > _______________________________________________
>>>>> > 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
>>
>>
>


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

Re: Partial Expression proposal

Mike Samuel
On Thu, Dec 28, 2017 at 12:10 PM, Tamás Halasi <[hidden email]> wrote:
> Damn.
> I wonder why is that useful.
> But whatever.
>
> What symbol do you think would be the best?
> A binary operator have to have an expression at its left side, so *, /, %,
>>, <, &, ^ or | might be good.

If we focused on whether the feature set is desirable given the
balance of existing features and use cases,
we could later bikeshed after we're informed enough to weigh the
benefit vs cost of consuming available punctuation.
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Partial Expression proposal

Tamás Halasi
How could we find out whether the feature is desirable? Just find a lot of use cases? Or write a *Purpose* paragraph?

2017-12-28 20:29 GMT+01:00 Mike Samuel <[hidden email]>:
On Thu, Dec 28, 2017 at 12:10 PM, Tamás Halasi <[hidden email]> wrote:
> Damn.
> I wonder why is that useful.
> But whatever.
>
> What symbol do you think would be the best?
> A binary operator have to have an expression at its left side, so *, /, %,
>>, <, &, ^ or | might be good.

If we focused on whether the feature set is desirable given the
balance of existing features and use cases,
we could later bikeshed after we're informed enough to weigh the
benefit vs cost of consuming available punctuation.


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

Re: Partial Expression proposal

Mike Samuel
Maybe take a shortish but non-trivial piece of code, rewrite it to use the proposed syntax.  Then explain what about the rewritten code makes it clearer, more maintainable, etc. than the code before.


On Dec 28, 2017 2:44 PM, "Tamás Halasi" <[hidden email]> wrote:
How could we find out whether the feature is desirable? Just find a lot of use cases? Or write a *Purpose* paragraph?

2017-12-28 20:29 GMT+01:00 Mike Samuel <[hidden email]>:
On Thu, Dec 28, 2017 at 12:10 PM, Tamás Halasi <[hidden email]> wrote:
> Damn.
> I wonder why is that useful.
> But whatever.
>
> What symbol do you think would be the best?
> A binary operator have to have an expression at its left side, so *, /, %,
>>, <, &, ^ or | might be good.

If we focused on whether the feature set is desirable given the
balance of existing features and use cases,
we could later bikeshed after we're informed enough to weigh the
benefit vs cost of consuming available punctuation.



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