Skip to content

Assignment #138

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

Merged
merged 2 commits into from
Sep 10, 2018
Merged

Assignment #138

merged 2 commits into from
Sep 10, 2018

Conversation

cthulahoops
Copy link
Collaborator

First steps in this. Need to generalise to support other iterators not just tuples.

Ok(ast::LocatedStatement {
location: ast::Location::new(1, 1),
node: ast::Statement::Assign {
targets: vec![ast::Expression::Tuple {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of expressions are allowed at the left hand side (LHS)? Is it tuples, names only? Or are lists also allowed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tuples, lists, names, attributes, indices, slices.

I'm not sure if there are any others.

@@ -1045,6 +1046,19 @@ impl VirtualMachine {
}
None
}
bytecode::Instruction::UnpackSequence { size } => {
let value = self.pop_value();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a type check here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The full implementation requires __iter__, which you've just started to provide. I'll extend this to call that.

@windelbouwman
Copy link
Contributor

Nice job!

@windelbouwman windelbouwman merged commit 803a823 into master Sep 10, 2018
@windelbouwman windelbouwman deleted the assignment branch February 10, 2019 12:59
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

Successfully merging this pull request may close these issues.

2 participants