Skip to content

Parenless function calling #2

@gabejohnson

Description

@gabejohnson

I like big butts, but not on my function calls

const sum3 = x => y => z => x+y+z;
sum3(1)(2)(3); // 6

Wouldn't it be nice to live in this world?

sum3 1 2 3; // 6

ASI is the big problem with this syntax.

sum3 1
     2
     3;

But maybe this could work

(sum3 1
      2
      3);

or this

sum3 1
   \ 2
   \ 3;

sum3 1 \
     2 \
     3;

I might prototype it in sweet.js to see where it goes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions