home *** CD-ROM | disk | FTP | other *** search
/ M.u.C.S. Disc 2000 / MUCS2000.iso / sound / mp2_099 / src / gem / libshoe.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-04  |  1.2 KB  |  44 lines

  1.    /* libshoe.h
  2.  *
  3.  * COPYRIGHT (c) 1998 by Fredrik Noring.
  4.  */
  5.  
  6. #define ONE_K   1024L
  7. #define ONE_MEG (ONE_K*ONE_K)
  8.  
  9. #define HEAP_SIZE   (100*ONE_K)
  10. #define GC_MINIMUM  (4*ONE_K)
  11. #define MAX_SYMBOLS (9999)
  12.  
  13. #define T                memdup("#t")
  14. #define F                memdup("#f")
  15. #define ERR              (trace?panic("#ERR."):memdup("#ERR."))
  16. #define FP(x)            MATCH((x), F)
  17. #define TP(x)            (!FP(x))
  18. #define NILP(x)          MATCH((x), "()")
  19. #define LISTP(x)         ((x)[0] == '(')
  20. #define MATCH(a, b)      (strcmp((a), (b)) == 0)
  21. #define DIGITP(c)        ((c) >= '0' && (c) <= '9')
  22. #define EVAL(x)          eval(car(x))
  23. #define EVALARG(x)       EVAL(cdr(x))
  24. #define DUAL_EVAL(s, op) \
  25.   Byte *a, *b; \
  26.   s = push_stack(s); a = push_stack(EVAL(s)); \
  27.   b = push_stack(EVALARG(s)); op; pop_n_elems(3); return s;
  28.  
  29. typedef long Int;
  30. typedef float Real;
  31. typedef char Byte;
  32.  
  33. extern Byte *eval(Byte *s);
  34. extern Int inquire_balance(void);
  35. extern Byte *parse_eval(Byte *input);
  36. extern void bootstrap();
  37. extern void bif(Byte *symbol, void *f);
  38. extern Byte *mem(Int amount);
  39. extern Byte *memdup(Byte *s);
  40. extern Byte *car(Byte *s);
  41. extern Byte *cdr(Byte *s);
  42.  
  43. extern Byte *decode_string(Byte *s);
  44.