gkz / LiveScript

LiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate. While LiveScript adds many features to assist in functional style programming, it also has many improvements for object oriented and imperative programming.
http://livescript.net
MIT License
2.32k stars 155 forks source link

New syntax for arguments proposal #1044

Open askucher opened 6 years ago

askucher commented 6 years ago

Currently we have

func = (arg1, arg2, arg3)-->
   ....

or

func = (arg1) -> (arg2, arg3)-->
   ....

I think it is good to have

func = (arg1 | arg2, arg3)-->
   ....
hmaurer commented 6 years ago

I think it would also be good to have

func = (arg{1..3})-->
 ...

Like the range syntax in Haskell, to avoid having to write arg1, arg2, arg3. It's a waste of characters methinks.

rhendric commented 6 years ago

@hmaurer, if this is a serious proposal, would you create a new issue for it please? (Also, do you know about &0, &1, etc.?)

hmaurer commented 6 years ago

@rhendric Sorry, I was trolling 🙄

rhendric commented 6 years ago

:dart: You got me!

(For the future, though, please don't; given the quality of ideas that get proposed around here sometimes, I kind of have to assume that they're all sincere.)

danielo515 commented 5 years ago

I don't understand what is the objective of this proposal. Is for currying some arguments ?