[erlang-questions] Why can't you have a variable before a string with pattern matching?
Thu May 31 21:18:37 CEST 2007
El Thursday 31 May 2007 19:37:14 Jordan Wilberding escribió:
> I was just wondering why having
> fcn("text" ++ String) -> ..
> is legal, but doing
> fcn(String ++ "text")
> is not legal. Is this for performance reasons, or something else?
This is an speculation, but it's probably because it's easy for the compiler
to see that the first pattern is time-bounded, while the second is not
(because it depends on the lenght of the string).
More information about the erlang-questions