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

Pretty return #12

Merged
merged 3 commits into from
Apr 6, 2020
Merged

Pretty return #12

merged 3 commits into from
Apr 6, 2020

Conversation

ViliamVadocz
Copy link
Collaborator

Printing the return from main() now supports all currently existing types.

  • When returning functions, their signature is printed
  • When returning iterators, the type is printed
  • When returning lists, the elements are printed
  • Aggregate types inside other types get a shorthand name life *list* or *function*

What's left:

  • printing vectors once they are added
  • custom structs?

@@ -113,6 +113,8 @@ def number_iter(self, tree: TypeTree):
start = read_environment(b, args[0], env_types)[0]
b.ret(b.add(start, args[1]))

# TODO going in reverse
Copy link
Owner

Choose a reason for hiding this comment

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

what is this about?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

0..10 gives

i => {i >= 0; i < 10; :> i}

I want 10..0 to give

i => {i >= 0; i < 10; :> 9 - i} 
# 9 and not 10, because I want 10..0 to be reverse of 0..10

This is not related to the pretty return, so I can remove it.

Copy link
Owner

Choose a reason for hiding this comment

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

ah makes sense

@LHolten LHolten merged commit 3c19651 into LHolten:volpe Apr 6, 2020
@ViliamVadocz ViliamVadocz deleted the pretty-return branch April 6, 2020 14:22
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