size of an IO list

Daniel Luna <>
Wed Mar 2 19:01:49 CET 2005


On Wed, 2 Mar 2005, Joe Armstrong (AL/EAB) wrote:
> How about a BIF to compute the size of an I/O list?
>
> Why?
>
> I have made a deep list that I want to output (guess what's it's HTML :-)
>
> I need to make an HTTP header element  "Content-Length: ..."
>
> Which is the size of the flattened deep list , but I don't want to flatten it (horrors)
> or traverse it (in Erlang) to find the length.
>
> Suitable case for a BIF?

There is lists:flatlength/1 that does this, unfortunately it's not a BIF.

/Luna
-- 
Daniel Luna                           | Top reasons that I have a beard:
                     |  a) Laziness.
http://www.update.uu.se/~luna/        |  b) I can.
Don't look at my homepage (it stinks).|  c) I can get away with it.



More information about the erlang-questions mailing list