Erlang practice on DAY 1 1. Make a list of two 3-tuples. Bind to L. 2. Retrieve the second tuple in L. 3. Remove the first tuple from L, bind resulting list to L2. 4. Make a tuple that contains the list [1, 2], the tuple {a, b}, the atom true. Bind to T1. 5. Make a list that has the two tuples T1 and {100, 101} In-class answers appended here: 1. Make a list of two 3-tuples. Bind to L. 98> L = [ {1, 2, 3}, {a, b, c} ]. 2. Retrieve the second tuple in L. 100> [ _, X] = L. [{1,2,3},{a,b,c}] 101> X. {a,b,c} 102> tl(L). [{a,b,c}] 103> hd ( tl (L) ). {a,b,c} 3. Remove the first tuple from L, bind resulting list to L2. 105> L2 = [ X | [] ]. [{a,b,c}] 106> L2. [{a,b,c}] 107> L3 = tl(L). % using L3 instead of L2 [{a,b,c}] 108> L3. [{a,b,c}] 4. Make a tuple that contains the list [1, 2], the tuple {a, b}, the atom true. Bind to T1. 111> T1 = { [1, 2 ], {a, b}, true }. {[1,2],{a,b},true} 5. Make a list that has the two tuples T1 and {100, 101} L5 = [ T1, {100, 101} ] . [{[1,2],{a,b},true},{100,101}]