Try/Cond

Luke Gorrie luke@REDACTED
Fri Oct 24 15:52:29 CEST 2003


Vance Shipley <vances@REDACTED> writes:

> last(List) ->
> 	B = list_to_binary(List),
> 	S = size(B) - 8,
> 	<<_:S, Last:8>> = B,
> 	Last.

or of course

  last(L) -> (foldl(fun(X, _) -> fun() -> X end end, [], L))().

-Luke




More information about the erlang-questions mailing list