kaffeine icon indicating copy to clipboard operation
kaffeine copied to clipboard

decompose assignment

Open weepy opened this issue 15 years ago • 8 comments

like

[x,y] = [1,0]
{x} = [2]

weepy avatar Aug 11 '10 12:08 weepy

named destructured_assignment. working for arrays

weepy avatar Aug 17 '10 10:08 weepy

dont need this - hardly ever needed

weepy avatar Nov 21 '10 10:11 weepy

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)

ghost avatar Jan 23 '11 00:01 ghost

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.

weepy avatar Jan 23 '11 09:01 weepy

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.

akidee avatar Apr 17 '11 01:04 akidee

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] = ?

weepy avatar Apr 17 '11 08:04 weepy

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

benekastah avatar Jun 13 '11 16:06 benekastah

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

On Mon, Jun 13, 2011 at 5:55 PM, benekastah < [email protected]>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: https://github.com/weepy/kaffeine/issues/5#issuecomment-1360196

weepy avatar Jun 13 '11 17:06 weepy