Archived
1
0
Fork 0
This repository has been archived on 2023-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
lispy/lval/base.h

25 lines
482 B
C
Raw Normal View History

2018-06-07 19:10:53 -04:00
#ifndef LVAL_BASE
#define LVAL_BASE
typedef union typeval {
long num;
double dec;
} TypeVal;
// A lispy value can either be a number, error, symbol, or an expression
typedef struct lval {
int type;
TypeVal data;
// Error and symbols contain string data
char* err;
char* sym;
// Count and pointer to a list of lval*
int count;
struct lval** cell;
} lval;
// Possible lispy value types
enum { LVAL_ERR, LVAL_LONG, LVAL_DOUBLE, LVAL_SYM, LVAL_SEXPR, LVAL_QEXPR };
#endif