[erlang-questions] Pattern matching in function calls

Gleb Peregud gleber.p@REDACTED
Fri Apr 15 22:55:25 CEST 2011

On Fri, Apr 15, 2011 at 22:44, Jachym Holecek <freza@REDACTED> wrote:
> I don't think so; gen_fsm is brilliant for purely event-driven automata but
> would be very ugly for a task like this. What the CSV guy needs to do is:
>  1) Get rid of #ecsv{} record, that's overkill for such a trivial purpose.
>  2) Break the parser into a bunch of tiny functions, pass all necessary
>     data in arguments.

Here's a csv parser which I got somewhere from the internet and
modified a bit (it does some dumb heuristic to handle badly formatted
csv files), which is implemented exactly this way
-------------- next part --------------
A non-text attachment was scrubbed...
Name: csv.erl
Type: text/x-erlang
Size: 1837 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110415/2bea5fa2/attachment.bin>

More information about the erlang-questions mailing list