Skip to content

pull request for hw concurrency#24

Open
mariomanoptic wants to merge 3 commits intopragdave:masterfrom
mariomanoptic:master
Open

pull request for hw concurrency#24
mariomanoptic wants to merge 3 commits intopragdave:masterfrom
mariomanoptic:master

Conversation

@mariomanoptic
Copy link

No description provided.


def next_value(agent) do
# « your code goes here»
value = Agent.get_and_update(agent, fn val -> {val, val +1} end}
Copy link
Owner

Choose a reason for hiding this comment

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

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))
Copy link
Owner

Choose a reason for hiding this comment

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

div returns the wrong value for the chunk size (try it with 10 and 4: you get 2, but it should be 3)

-2

@pragdave
Copy link
Owner

I'd love to give you a grade, but I have no idea who you are...

@TannerMarsall
Copy link

Sorry, I thought I had put my name as a comment on the pull request. My name is Tanner Marshall. ID: 47350385

@pragdave
Copy link
Owner

pragdave commented Oct 24, 2019 via email

@TannerMarsall
Copy link

My pull reqest number is #24

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.

3 participants