Optimize some ++ situations
"Christofer Tornkvist (ctornkvi)" <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, would it be a stupid suggestion to let add a parameter of list type to all built-in and library functions returning a list. The additional list parameter will represent a list-tail that will be appended to the result. Append would be accomplished by [ ListResult| MyTail ]. If this was the case, the complier can optimize code like; erlang:atom_to_list(Atom) ++ MyTail into erlang:atom_to_list(Atom, MyTail) or lists:map(Fun, List) ++ MyTail into lists:map(Fun, List, MyTail) Or is the compiler able to see this optimization anyhow? Cheers! /Christofer