pull request for hw concurrency#24
Open
mariomanoptic wants to merge 3 commits intopragdave:masterfrom
Open
Conversation
pragdave
reviewed
Oct 21, 2019
|
|
||
| def next_value(agent) do | ||
| # « your code goes here» | ||
| value = Agent.get_and_update(agent, fn val -> {val, val +1} end} |
Owner
There was a problem hiding this comment.
This line fails to compile for two different reasons:
** (SyntaxError) 2.exs:82: unexpected token: }. The "(" at line 82 is missing terminator ")"
- the trailing } should be )
I fixed that and I get
** (CompileError) 2.exs:82: "val +1" looks like a function call but there is a variable named "val", please use explicit parentheses or even spaces
If I fix both of these, then I get warnings about unused variables.
0
| # I'm hoping to see a simple pipeline as the body of this function... | ||
| # "running" function | ||
| def pmap(collection, process_count, function) do | ||
| Enum.chunk_every(collection, div(Enum.count(collection),process_count)) |
Owner
There was a problem hiding this comment.
div returns the wrong value for the chunk size (try it with 10 and 4: you get 2, but it should be 3)
-2
Owner
|
I'd love to give you a grade, but I have no idea who you are... |
|
Sorry, I thought I had put my name as a comment on the pull request. My name is Tanner Marshall. ID: 47350385 |
Owner
|
what is your PR number?
…On Thu, Oct 24, 2019 at 12:59 PM Tanner Marshall ***@***.***> wrote:
Sorry, I thought I had put my name as a comment on the pull request. My
name is Tanner Marshall. ID: 47350385
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#24?email_source=notifications&email_token=AAACTGGWJG2AKFXMDXGZXHDQQHO7ZA5CNFSM4JCOGPN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECF42TI#issuecomment-546032973>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACTGEHPKB5UWV7NLC5TD3QQHO7ZANCNFSM4JCOGPNQ>
.
|
|
My pull reqest number is #24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.