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

Unpack tuple to multiple targets not supported #37

Open
gordianknotC opened this issue Mar 26, 2015 · 2 comments
Open

Unpack tuple to multiple targets not supported #37

gordianknotC opened this issue Mar 26, 2015 · 2 comments
Labels

Comments

@gordianknotC
Copy link

def kproperty(exports):
    exports.L2, exports.L1, exports.L0 = L2, L1, L0  # works

    exports.L2, exports.L1, exports.L0 = L2, L1, L0 = (2, 1, 0) # failed

which generates

function kproperty(exports) {
    var _$rapyd$_Unpack;
    _$rapyd$_Unpack = [L2, L1, L0];
    exports.L2 = _$rapyd$_Unpack[0];
    exports.L1 = _$rapyd$_Unpack[1];
    exports.L0 = _$rapyd$_Unpack[2];

    _$rapyd$_Unpack = [L2, _$rapyd$_Unpack = [2, 1, 0]; 
    L1 = _$rapyd$_Unpack[0];
    L0 = _$rapyd$_Unpack[1]];
    exports.L2 = _$rapyd$_Unpack[0];
    exports.L1 = _$rapyd$_Unpack[1];
    exports.L0 = _$rapyd$_Unpack[2];
}
@atsepkov
Copy link
Owner

good catch, will investigate this

@kovidgoyal
Copy link
Contributor

This is fixed in my fork. https://github.com/kovidgoyal/rapydscript-ng

@atsepkov This is not a single commit as there were many related issues that needed to be fixed. Just look at all commits made today.

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

No branches or pull requests

3 participants