Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change named parameter format #59

Closed
mhevery opened this issue Oct 3, 2014 · 8 comments
Closed

Change named parameter format #59

mhevery opened this issue Oct 3, 2014 · 8 comments

Comments

@mhevery
Copy link
Contributor

mhevery commented Oct 3, 2014

current

method({value:'default'}:{value:String})

requires that we repeat the value twice

proposed syntax

method({value:String='default'})
@mhevery
Copy link
Contributor Author

mhevery commented Oct 3, 2014

@vojtajina @tbosch What do you think?

@IgorMinar
Copy link
Contributor

So what would this ES6 code look like? with type annotations and default values?

books.forEach(function ({ title: title, author: author }) {
  console.log(title, author)
});

@mhevery
Copy link
Contributor Author

mhevery commented Oct 17, 2014

@IgorMinar I was not aware of this syntax. Could you point me to ES6 spec where this syntax is described?

@tbosch
Copy link
Contributor

tbosch commented Oct 18, 2014

Igor is right,
this would not work.
And we should not forbid parameter name renaming, as otherwise not all
valid ES6
programs valid AtScript programs...

On Fri, Oct 17, 2014 at 1:27 PM, Miško Hevery notifications@github.com
wrote:

@IgorMinar https://github.com/IgorMinar I was not aware of this syntax.
Could you point me to ES6 spec where this syntax is described?


Reply to this email directly or view it on GitHub
#59 (comment).

@tbosch
Copy link
Contributor

tbosch commented Oct 18, 2014

We should do whatever TypeScript is doing in this case.

@IgorMinar
Copy link
Contributor

@tbosch typescript hasn't solved this yet.

@mhevery
Copy link
Contributor Author

mhevery commented Nov 25, 2014

The current syntax is correct.

@mhevery mhevery closed this as completed Nov 25, 2014
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants