12 #define NUMBER(G, X) atom_as_expr(create_number_atom(G, X))
13 #define STRING(G, S) atom_as_expr(create_string_atom(G, S, NULL))
14 #define SYMBOL(G, S) atom_as_expr(create_symbol_atom(G, S, NULL))
15 #define CONS(G, CAR, CDR) cons_as_expr(create_cons(G, CAR, CDR))
16 #define NIL(G) SYMBOL(G, "nil")
25 // TODO(#285): there is no way to execute struct Expr
35 struct Expr atom_as_expr(struct Atom *atom);
36 struct Expr cons_as_expr(struct Cons *cons);
37 struct Expr void_expr(void);
38 struct Expr clone_expr(Gc *gc, struct Expr expr);
40 void destroy_expr_rec(struct Expr expr);
41 void destroy_expr(struct Expr expr);
42 void print_expr_as_sexpr(struct Expr expr);
56 float num; // ATOM_NUMBER
57 char *sym; // ATOM_SYMBOL
58 char *str; // ATOM_STRING
62 struct Atom *create_number_atom(Gc *gc, float num);
63 struct Atom *create_string_atom(Gc *gc, const char *str, const char *str_end);
64 struct Atom *create_symbol_atom(Gc *gc, const char *sym, const char *sym_end);
65 void destroy_atom(struct Atom *atom);
66 void print_atom_as_sexpr(struct Atom *atom);
74 struct Cons *create_cons(Gc *gc, struct Expr car, struct Expr cdr);
75 void destroy_cons(struct Cons *cons);
76 void destroy_cons_rec(struct Cons *cons);
77 void print_cons_as_sexpr(struct Cons *cons);