#define NCELLS 50000
#define TWICE_NCELLS 100000

#define CELL_SIZE 4
#define CELLS_PER_PAIR 2

#define MAX_ATOM_HASH 4096
#define MAX_GLOBAL_HASH 4096

// token types

#define NULL_TOK 0
#define OPAR_TOK 1
#define CPAR_TOK 2
#define DOT_TOK 3
#define ATOM_TOK 4
#define TIC_TOK 5
#define STRING_TOK 6
#define VECTOR_TOK 7
#define EOF_TOK 8

#define newline_char 10

// cell mark bit for garbage collection

#define MARK_BIT       0x80000000
#define NOT_MARK_BIT   0x7fffffff

// primitive types

#define NULLTYPE        0x00000000
#define LISTTYPE        0x00000000
#define VECTORTYPE      0x20000000
#define BOOLTYPE        0x40000000
#define CHARTYPE        0x60000000
#define PROCTYPE        0x10000000

// primitive vector subtypes

#define VECTORSUBTYPE   0x00000000
#define INTEGERSUBTYPE  0x01000000
#define REALSUBTYPE     0x02000000
#define PORTSUBTYPE     0x03000000
#define SYMBOLSUBTYPE   0x04000000
#define STRINGSUBTYPE   0x05000000

// boolean type values

#define Mfalse          0x40000000
#define Mtrue           0x40000001

// machine operation types

#define M1_VECTOR_LENGTH_INTEGER 0
#define M1_DISPLAY 1
#define M1_WRITE_CHR 2
#define M1_CHARNUM 3
#define M1_CHARALPHA 4
#define M1_CHARUP 5
#define M1_CHARDOWN 6
#define M1_MAKE_STRING_INTEGER 7
#define M1_STRING_LENGTH_INTEGER 8
#define M1_STRING_TO_SYMBOL 9
#define M1_STRING_TO_NUMBER 10
#define M1_NUMBER_TO_STRING 11
#define M1_SYMBOL_TO_STRING 12
#define M1_MAKE_VECTOR_INTEGER 13
#define M1_WRITEOUT 14
#define M1_CHAR_TO_INT 15
#define M1_INTTOCHAR 16
#define M1_PAIRP 17
#define M1_KAAR 18
#define M1_KDAR 19
#define M1_KADR 20
#define M1_KDDR 21
#define M1_LENGTH_INTEGER 22
#define M1_BITWISENOT 23

#define M1_WAS_MY_FLOOR 24
#define M1_WAS_MY_CEILING 25
#define M1_WAS_MY_TRUNCATE 26
#define M1_WAS_MY_ROUND 27
#define M1_MY_EXACT_TO_INEXACT 28
#define M1_MY_INEXACT_TO_EXACT 29

#define M2_LIST_REF_INTEGER 0
#define M2_RPLACA 1
#define M2_RPLACD 2
#define M2_STRING_REF_INTEGER 3
#define M2_LIST_TAIL_INTEGER 4
#define M2_EQV 5
#define M2_MEMV 6
#define M2_ASSV 7
#define M2_MAKE_VECTOR_INTEGER_WITH_FILL 8
#define M2_MAKE_STRING_INTEGER_WITH_FILL 9
#define M2_MEMQ 10
#define M2_MEMBER 11
#define M2_ASSQ 12

// unary predicate ops

#define M1P_LISTP 0
#define M1P_STRINGP 1
#define M1P_VECTORP 2
#define M1P_EOF_OBJECT 3
#define M1P_CHARP 4
#define M1P_PROCEDUREP 5
#define M1P_BOOLP 6
#define M1P_INTEGERP 7

#define M1P_REALP 8

// binary predicate ops

#define M2P_CHAREQ 0
#define M2P_STRINGEQ 1
#define M2P_STRING_LT 2
#define M2P_STRING_GT 3
#define M2P_STRING_LE 4
#define M2P_STRING_GE 5
#define M2P_STRING_CI_LT 6
#define M2P_STRING_CI_GT 7
#define M2P_STRING_CI_LE 8
#define M2P_STRING_CI_GE 9
#define M2P_STRING_CI_EQ 10
#define M2P_EQUALP 11