removing last element from the list

Gaspar Chilingarov nm@REDACTED
Wed May 25 19:39:25 CEST 2005


Hi all!

are there any really fast ways to remove last element from list?

list size is 5-15 elements, but it's not known at compile time.

I need to implement something like FIFO, new elements inserted in list 
push old elements out.

now it looks line
NewList = [ Elem | lists:sublist(List, N-1)]

which probably is not the best way.

-- 
Gaspar Chilingarov
System Administrator

t +37491 419763
w www.web.am
e nm@REDACTED



More information about the erlang-questions mailing list