simplify the code generated for struct set syntax,
simplify the code generated for struct set syntax,

now it's just a function call and all the complexity is in the
implementation instead of recursive function calls in the generated
code.

this translates into readable erlang and allows to use the api by hand
by mere mortals

examples of the generated code:

this code:

@public
run = fn ()
    S = {a: {b: {c: 42}, d: 1}, e:2}

    A = S.a
    B = S.a.b
    C = S.a.b.c

    S1 = S.a.b.c := 1337
    S2 = S.a.b := {d: true}

generates this erlang code:

-module(new).

-export([run/0]).

run() ->
    S = {struct,
         [{a, {struct, [{b, {struct, [{c, 42}]}}, {d, 1}]}},
          {e, 2}]},
    A = struct:get(S, [a]),
    B = struct:get(S, [a, b]),
    C = struct:get(S, [a, b, c]),
    S1 = struct:set(S, [a, b, c], 1337),
    S2 = struct:set(S, [a, b], {struct, [{d, true}]}).

congratulations, you are reading a complete commit message!

DavidMikeSimon/efene,DavidMikeSimon/efene,DavidMikeSimon/efene,DavidMikeSimon/efene