[erlang-questions] Cost of Copy
James Hague
james.hague@REDACTED
Sun May 30 19:55:53 CEST 2010
A cons (to use the Lisp terminology) is a "something" and a pointer. In the
[57|List] example, one cons is created where the something is 57 and the
pointer is List. That's it. Two memory cells.
On Sat, May 29, 2010 at 7:26 PM, Henning Diedrich <hd2010@REDACTED>wrote:
> Hi James,
>
> can you clarify this for me, what you mean by "shared" ... I think I
> understood the rest of your post alright, thanks!
>
> Henning
>
>
> X = [57|List]
> This creates a single cons (2 cells). The first element is 57. The second is
> a pointer to List. So even though you've got two lists (X and List), all of
> the data is shared except for the first cons of X.
>
>
>
>
>
More information about the erlang-questions
mailing list