[erlang-questions] How to keep adding items to a data structure

Antonios Kouzoupis kouzan@REDACTED
Sun Apr 24 22:23:29 CEST 2016


On 04/24/2016 10:05 PM, Donald Steven wrote:
> Hi Antonios,
>
> You are kind and generous to help.  I'll study this carefully.  I will
> be wanting to add a list or a record, not just numbers.  Is this
> possible?
>

Well I don't know exactly what you want to achieve, but the logic is the
same. In [Num | Acc], instead of adding numbers you can add your
record/tuple/whatever. You might also need to reverse the list in the
edge case, when your counter reach zero.

-- 
Αντώνης Κουζούπης
Antonios Kouzoupis


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160424/cf88af33/attachment.bin>


More information about the erlang-questions mailing list