[erlang-questions] Rails Style String Inflection For Erlang

1 view
Skip to first unread message

Luke Galea

unread,
Sep 8, 2008, 9:32:16 PM9/8/08
to erlang-q...@erlang.org
Hi erlangers,

Thanks to the help I received on this list, I've managed to complete
inflector.erl. You can get it at http://www.ideaforge.org/blog/?p=11

It handles everything relevant that ruby's ActiveSupport inflector
can do: pluralize, singularize, camelcase, etc.

There was a lot of discussion re: pattern matching versus regular
expressions. Ultimately I chose to release this first version with
the R12B4 regexps, but cached them to minimize the overhead from
compiling.

I think there might be some value in separating out the regexp cache,
unless there is a simpler way to avoid recompiling regexps that I
missed.

Thanks again for everyone's help.

-- Luke Galea
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions

Reply all
Reply to author
Forward
0 new messages