[erlang-questions] String continuation

Robert Virding robert.virding@REDACTED
Thu Jan 13 22:16:23 CET 2011


----- "Ulf Wiger" <ulf.wiger@REDACTED> wrote:

> On 13 Jan 2011, at 19:07, Evgeniy Khramtsov wrote:
> 
> > ++ operator is slow. It is better to use dialyzer in order to track
> such errors.
> 
> 
> Efficiency Guide, Chapter 2.4 - Myth: '++' is always bad
> http://erlang.org/doc/efficiency_guide/myths.html#id54761

It gets even better. The compiler will at compile time optimise "string3" ++ "string4" to "string3string4". So:

"string3" "string4" --> "string3string4" during parsing
"string3" ++ "string4" --> "string3string4" during compiling

There is no escape.

Robert

-- 
Robert Virding, Erlang Solutions Ltd.



More information about the erlang-questions mailing list