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

add extract combinator to Encore #271

Merged
merged 2 commits into from
Nov 11, 2015

Conversation

kikofernandez
Copy link
Contributor

  • add the extract combinator to encore
  • this commit also refactors the tests for the parallel combinators into its own test folder
  • add documentation for extract combinator

@kikofernandez
Copy link
Contributor Author

the segfaults are not related to the parallel combinators. They are related to a mainstream bug in #274. This PR can be reviewed and merged

@kikofernandez
Copy link
Contributor Author

rebased so that it can potentially be merged!

in
print |arr|
}|

Copy link
Contributor

Choose a reason for hiding this comment

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

  • return -> returns
  • Maybe say that the runtime will try to choose the one that gets better performance (or are there guarantees?)
  • Use : rather than :: to denote the type (in the comment) as this is the Encore syntax
  • How about an example that prints the contents of the array instead of just the length?
    for n in arr print n

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes.

  • Maybe say that the runtime will try to choose the one that gets better performance (or are there guarantees?)

Yes, you are right. Currently it chooses the get operation by default but I envision something more advanced soon

get test.test_int_and_dec();
get test.test_from_string_to_int();
get test.test_switch_test();
get test.test_passive_object();
Copy link
Contributor

Choose a reason for hiding this comment

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

What are these tests for? They don't seem to have anything to do with extract.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these tests are testing that they produce the right value before using the parallel combinators.
testing the tests...

@EliasC
Copy link
Contributor

EliasC commented Nov 10, 2015

The tests are mixing snake_case and camelCase. There's no standard for Encore programs, but at least we should be consistent within the same file.

encore_arg_t data;
struct list_t* next;
} list_t;

Copy link
Contributor

Choose a reason for hiding this comment

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

If we ever want to reuse the list, it will probably make sense to use a separate struct for the list header (with a pointer to the first node). This makes the list more imperative (no need to save intermediate results when pushing) and makes it possible to differentiate between "no list" (list is NULL) and "empty list" (first-pointer is NULL).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it could be useful but, at the moment, I would not do a refactoring on something that might or might not happen. if there's a need, we can re-consider

@EliasC
Copy link
Contributor

EliasC commented Nov 10, 2015

My comments are mostly minor! If these are fixed (or rebutted) I think this can be merged.

@EliasC
Copy link
Contributor

EliasC commented Nov 11, 2015

@kikofernandez Are you done reacting to comments? In that case I will merge this later today.

@kikofernandez
Copy link
Contributor Author

yes, I think so

Kiko Fernandez Reyes added 2 commits November 11, 2015 12:41
add the `extract` combinator to encore. this commit also refactors the
tests for the parallel combinators into its own test folder with tests
for each of the combinators.
@kikofernandez
Copy link
Contributor Author

added party_extract to CCodeNames

@EliasC
Copy link
Contributor

EliasC commented Nov 11, 2015

Good last change. Merging now!

EliasC added a commit that referenced this pull request Nov 11, 2015
@EliasC EliasC merged commit 8754b19 into parapluu:features/plenary Nov 11, 2015
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