[ prog / sol / mona ]

prog


Zig

14 2023-10-15 20:58

Actually#2 now that I think about it, one could define a function that
preprocesses the tuple into something that has the type:

const SExpr : type = struct {
    symbol : Symbol,
    pair : struct {
        left : *SExpr,
        right : *SExpr,
    },
    nil : void,
    // etc etc
};

(Where symbol could be an integer hash of the tag names)
Once you have this, It should not be hard to make an interperter
Additionally, if we really wanted a the previous representation,
we could make a function that converts a comptime known SExpr back
into nested tuples like before

30


VIP:

do not edit these