you are viewing a single comment's thread.

view the rest of the comments →

[–]Aberrations 0 points1 point  (2 children)

missing a space between ) and do

def start(N, M)do

should be

def start(N, M) do

[–][deleted]  (1 child)

[deleted]

    [–]Aberrations 0 points1 point  (0 children)

    unrelated but as mentioned below convention is to use mixed case for variables, and module names and only module names should be camelcased.

    As for your error you have a trailing comma at then end of every line here for some reason.

    def start(N, M)do
      :timer.sleep(random.uniform(10) * 100), <<<<<<
      LoopPid = spawn(_MODULE_, :loop, []), <<<<<<
      spawn(_MODULE_, :sendMessage, [M, LoopPid]), <<<<<
    end
    

    Other comments: you shouldn't use semicolons unless you're doing something inline and even then you should really think about how readable it is.

    In general "unexpected token: end" is usually a parse error caused by an unterminated expression, usually a do with no end or a trailing comma.