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

decompose assignment #5

Open
weepy opened this issue Aug 11, 2010 · 8 comments
Open

decompose assignment #5

weepy opened this issue Aug 11, 2010 · 8 comments

Comments

@weepy
Copy link
Owner

weepy commented Aug 11, 2010

like

[x,y] = [1,0]
{x} = [2]
@weepy
Copy link
Owner Author

weepy commented Aug 17, 2010

named destructured_assignment. working for arrays

@weepy
Copy link
Owner Author

weepy commented Nov 21, 2010

dont need this - hardly ever needed

@ghost
Copy link

ghost commented Jan 23, 2011

I use them all the time. Some common cases I use a lot ..
[oldx, x] = [x, newx]
[a, b, c] = str.split('|')
[all, domain, path] = /https?://([^\/]+)(.*)$/i.exec(url)

@weepy
Copy link
Owner Author

weepy commented Jan 23, 2011

well the great thing about kaffeine is that it's modular and so pretty easy to create a plugin to do just this.

let me know if you'd like to try and i can help u out.

@akidee
Copy link

akidee commented Apr 17, 2011

Should work, since it works while unwrapping async calls:

e, result = asyncFunc! x, y, z

asyncFunc(x, y, z, function(_0, _1) { var e, result; e = _0, result = _1
})

But using normal calls does not work:

e, result = asyncFunc x, y, z

 var result; e, result = asyncFunc(x, y, z)

Both cases should be treated consistently.

@weepy
Copy link
Owner Author

weepy commented Apr 17, 2011

Good point. It could be added if it proves sufficiently useful. Perhaps there's an ambiguousness here that you've picked up on. We could move to the move coffeescript style [e, result] = ?

@benekastah
Copy link
Contributor

I think that move would be good, since Firefox accepts that syntax already. It would be consistent with what people expect.

@weepy
Copy link
Owner Author

weepy commented Jun 13, 2011

yeah - it would be good - just haven't got around to it !

On Mon, Jun 13, 2011 at 5:55 PM, benekastah <
reply@reply.github.com>wrote:

I think that move would be good, since Firefox accepts that syntax already.
It would be consistent with what people expect.

Reply to this email directly or view it on GitHub:
#5 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants