[erlang-questions] Tuples referencing each other problem

Krzysztof Jurewicz krzysztof.jurewicz@REDACTED
Sun Sep 17 10:17:16 CEST 2017


Grzegorz Junka writes:

> Is it possible to create two tuples that reference each other in Erlang? 
> Something like:
>
> T1 = {T2}
> T2 = {T1}

Data structures in Erlang are generally immutable, hence it is not possible to do it in a simple way. To achieve this, you would need to introduce mutability, for example store tuples in a database and reference them by database ids (you may want to look at ETS for this purpose).



More information about the erlang-questions mailing list