[erlang-questions] newbie question

Charles Hixson <>
Thu Nov 6 19:56:27 CET 2014

Given the routine:
     chunks(str, []).

chunks("", lst)->
chunks(str, lst)->
     P1 = "^([[:alnum:]]+|[[:space:]]+|[[:punct:]]+|[[:cntrl:]]+|.)",
     [[], M1, T1] = re:split(str, P1, [{return, list}]),
     [M1 | chunks(T1, P1)].

and the shell:
47> c(chunks).

Why do I get:
49> chunks:chunks("Able was I ere I saw Elba.").
** exception error: no function clause matching chunks:chunks("Able was 
I ere I saw Elba.") (chunks.erl, line 15)
(Well, forget the like 15.  I took out a bunch of comments.)

More information about the erlang-questions mailing list