Inside of this first step towards a bootstrapped scheme interpreter I find the following set of typedef, struct, union, and enum definitions:
typedef enum {FIXNUM} object_type;
typedef struct object {
object_type type;
union {
struct {
long value;
} fixnum;
} data;
} object;
In particular, I'm not sure I understand the point of the struct inside the union (struct { long value; } fixnum;
) -- a struct with only one field, to hold a single long? Very strange.
But I'm not really sure I understand the larger point, too. I think what's going on with the enum definition is that he's setting up a number of possible type values for lexical entities, and that object
is a way of holding these, but perhaps somebody with more practice in C than I have can offer a more detailed explanation.
Thanks!