bug or feature?

Serge Aleynikov serge@REDACTED
Thu Apr 20 22:32:02 CEST 2006


Richard A. O'Keefe wrote:
> Of course, if "extensive prefix analysis" means analysing many strings
> using a small number of prefixes, it's easy enough to generate an
> Erlang function (checking for those particular prefixes) *as a data structure*
> and cause it to be compiled, so that even in that case the main result from
> the generalised "feature" would be to prevent you thinking of a better
> solution.

Actually this is exactly the problem and the approach we took that 
triggered this email thread.  Given a relatively small number of 
prefixes (unknown at compile time) and analysing many strings, we tried 
to generate a function doing a pattern match of a string against each 
prefix.  It looked like having a fun(Prefix ++ Suffix, Prefix) notation 
would be a convenient representation for this task, when we realised it 
was an illegal expression.

Regards,

Serge



More information about the erlang-questions mailing list