altos/lisp: Remove some stale frame debugging checks
[fw/altos] / src / lisp / ao_lisp.h
1 /*
2  * Copyright © 2016 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  */
14
15 #ifndef _AO_LISP_H_
16 #define _AO_LISP_H_
17
18 #include <stdint.h>
19 #include <string.h>
20 //#include <stdio.h>
21 #include <ao_lisp_os.h>
22
23 typedef uint16_t        ao_poly;
24 typedef int16_t         ao_signed_poly;
25
26 #ifdef AO_LISP_SAVE
27
28 struct ao_lisp_os_save {
29         ao_poly         atoms;
30         ao_poly         globals;
31         uint16_t        const_checksum;
32         uint16_t        const_checksum_inv;
33 };
34
35 #define AO_LISP_POOL_EXTRA      (sizeof(struct ao_lisp_os_save))
36 #define AO_LISP_POOL    ((int) (AO_LISP_POOL_TOTAL - AO_LISP_POOL_EXTRA))
37
38 int
39 ao_lisp_os_save(void);
40
41 int
42 ao_lisp_os_restore_save(struct ao_lisp_os_save *save, int offset);
43
44 int
45 ao_lisp_os_restore(void);
46
47 #endif
48
49 #ifdef AO_LISP_MAKE_CONST
50 #define AO_LISP_POOL_CONST      16384
51 extern uint8_t ao_lisp_const[AO_LISP_POOL_CONST];
52 #define ao_lisp_pool ao_lisp_const
53 #define AO_LISP_POOL AO_LISP_POOL_CONST
54
55 #define _atom(n) ao_lisp_atom_poly(ao_lisp_atom_intern(n))
56
57 #define _ao_lisp_atom_quote     _atom("quote")
58 #define _ao_lisp_atom_set       _atom("set")
59 #define _ao_lisp_atom_setq      _atom("setq")
60 #define _ao_lisp_atom_t         _atom("t")
61 #define _ao_lisp_atom_car       _atom("car")
62 #define _ao_lisp_atom_cdr       _atom("cdr")
63 #define _ao_lisp_atom_cons      _atom("cons")
64 #define _ao_lisp_atom_last      _atom("last")
65 #define _ao_lisp_atom_length    _atom("length")
66 #define _ao_lisp_atom_cond      _atom("cond")
67 #define _ao_lisp_atom_lambda    _atom("lambda")
68 #define _ao_lisp_atom_led       _atom("led")
69 #define _ao_lisp_atom_delay     _atom("delay")
70 #define _ao_lisp_atom_pack      _atom("pack")
71 #define _ao_lisp_atom_unpack    _atom("unpack")
72 #define _ao_lisp_atom_flush     _atom("flush")
73 #define _ao_lisp_atom_eval      _atom("eval")
74 #define _ao_lisp_atom_read      _atom("read")
75 #define _ao_lisp_atom_eof       _atom("eof")
76 #define _ao_lisp_atom_save      _atom("save")
77 #define _ao_lisp_atom_restore   _atom("restore")
78 #else
79 #include "ao_lisp_const.h"
80 #ifndef AO_LISP_POOL
81 #define AO_LISP_POOL    3072
82 #endif
83 extern uint8_t          ao_lisp_pool[AO_LISP_POOL + AO_LISP_POOL_EXTRA];
84 #endif
85
86 /* Primitive types */
87 #define AO_LISP_CONS            0
88 #define AO_LISP_INT             1
89 #define AO_LISP_STRING          2
90 #define AO_LISP_OTHER           3
91
92 #define AO_LISP_TYPE_MASK       0x0003
93 #define AO_LISP_TYPE_SHIFT      2
94 #define AO_LISP_REF_MASK        0x7ffc
95 #define AO_LISP_CONST           0x8000
96
97 /* These have a type value at the start of the struct */
98 #define AO_LISP_ATOM            4
99 #define AO_LISP_BUILTIN         5
100 #define AO_LISP_FRAME           6
101 #define AO_LISP_LAMBDA          7
102 #define AO_LISP_NUM_TYPE        8
103
104 #define AO_LISP_NIL     0
105
106 extern uint16_t         ao_lisp_top;
107
108 #define AO_LISP_OOM             0x01
109 #define AO_LISP_DIVIDE_BY_ZERO  0x02
110 #define AO_LISP_INVALID         0x04
111 #define AO_LISP_UNDEFINED       0x08
112 #define AO_LISP_EOF             0x10
113
114 extern uint8_t          ao_lisp_exception;
115
116 static inline int
117 ao_lisp_is_const(ao_poly poly) {
118         return poly & AO_LISP_CONST;
119 }
120
121 #define AO_LISP_IS_CONST(a)     (ao_lisp_const <= ((uint8_t *) (a)) && ((uint8_t *) (a)) < ao_lisp_const + AO_LISP_POOL_CONST)
122 #define AO_LISP_IS_POOL(a)      (ao_lisp_pool <= ((uint8_t *) (a)) && ((uint8_t *) (a)) < ao_lisp_pool + AO_LISP_POOL)
123
124 void *
125 ao_lisp_ref(ao_poly poly);
126
127 ao_poly
128 ao_lisp_poly(const void *addr, ao_poly type);
129
130 struct ao_lisp_type {
131         int     (*size)(void *addr);
132         void    (*mark)(void *addr);
133         void    (*move)(void *addr);
134         char    name[];
135 };
136
137 struct ao_lisp_cons {
138         ao_poly         car;
139         ao_poly         cdr;
140 };
141
142 struct ao_lisp_atom {
143         uint8_t         type;
144         uint8_t         pad[1];
145         ao_poly         next;
146         char            name[];
147 };
148
149 struct ao_lisp_val {
150         ao_poly         atom;
151         ao_poly         val;
152 };
153
154 struct ao_lisp_frame {
155         uint8_t                 type;
156         uint8_t                 _num;
157         ao_poly                 prev;
158         struct ao_lisp_val      vals[];
159 };
160
161 #define AO_LISP_FRAME_NUM_MASK  0x7f
162
163 /* Set when the frame escapes the lambda */
164 #define AO_LISP_FRAME_MARK      0x80
165
166 static inline int ao_lisp_frame_num(struct ao_lisp_frame *f) {
167         return f->_num & AO_LISP_FRAME_NUM_MASK;
168 }
169
170 static inline int ao_lisp_frame_marked(struct ao_lisp_frame *f) {
171         return f->_num & AO_LISP_FRAME_MARK;
172 }
173
174 static inline struct ao_lisp_frame *
175 ao_lisp_poly_frame(ao_poly poly) {
176         return ao_lisp_ref(poly);
177 }
178
179 static inline ao_poly
180 ao_lisp_frame_poly(struct ao_lisp_frame *frame) {
181         return ao_lisp_poly(frame, AO_LISP_OTHER);
182 }
183
184 enum eval_state {
185         eval_sexpr,             /* Evaluate an sexpr */
186         eval_val,               /* Value computed */
187         eval_formal,            /* Formal computed */
188         eval_exec,              /* Start a lambda evaluation */
189         eval_cond,              /* Start next cond clause */
190         eval_cond_test,         /* Check cond condition */
191         eval_progn,             /* Start next progn entry */
192         eval_while,             /* Start while condition */
193         eval_while_test,        /* Check while condition */
194         eval_macro,             /* Finished with macro generation */
195 };
196
197 struct ao_lisp_stack {
198         uint8_t                 state;          /* enum eval_state */
199         ao_poly                 prev;           /* previous stack frame */
200         ao_poly                 sexprs;         /* expressions to evaluate */
201         ao_poly                 values;         /* values computed */
202         ao_poly                 values_tail;    /* end of the values list for easy appending */
203         ao_poly                 frame;          /* current lookup frame */
204         ao_poly                 list;           /* most recent function call */
205 };
206
207 static inline struct ao_lisp_stack *
208 ao_lisp_poly_stack(ao_poly p)
209 {
210         return ao_lisp_ref(p);
211 }
212
213 static inline ao_poly
214 ao_lisp_stack_poly(struct ao_lisp_stack *stack)
215 {
216         return ao_lisp_poly(stack, AO_LISP_OTHER);
217 }
218
219 extern struct ao_lisp_stack     *ao_lisp_stack;
220 extern struct ao_lisp_stack     *ao_lisp_stack_free_list;
221 extern ao_poly                  ao_lisp_v;
222
223 #define AO_LISP_FUNC_LAMBDA     0
224 #define AO_LISP_FUNC_NLAMBDA    1
225 #define AO_LISP_FUNC_MACRO      2
226 #define AO_LISP_FUNC_LEXPR      3
227
228 #define AO_LISP_FUNC_FREE_ARGS  0x80
229 #define AO_LISP_FUNC_MASK       0x7f
230
231 #define AO_LISP_FUNC_F_LAMBDA   (AO_LISP_FUNC_FREE_ARGS | AO_LISP_FUNC_LAMBDA)
232 #define AO_LISP_FUNC_F_NLAMBDA  (AO_LISP_FUNC_FREE_ARGS | AO_LISP_FUNC_NLAMBDA)
233 #define AO_LISP_FUNC_F_MACRO    (AO_LISP_FUNC_FREE_ARGS | AO_LISP_FUNC_MACRO)
234 #define AO_LISP_FUNC_F_LEXPR    (AO_LISP_FUNC_FREE_ARGS | AO_LISP_FUNC_LEXPR)
235
236 struct ao_lisp_builtin {
237         uint8_t         type;
238         uint8_t         args;
239         uint16_t        func;
240 };
241
242 enum ao_lisp_builtin_id {
243         builtin_eval,
244         builtin_read,
245         builtin_lambda,
246         builtin_lexpr,
247         builtin_nlambda,
248         builtin_macro,
249         builtin_car,
250         builtin_cdr,
251         builtin_cons,
252         builtin_last,
253         builtin_length,
254         builtin_quote,
255         builtin_set,
256         builtin_setq,
257         builtin_cond,
258         builtin_progn,
259         builtin_while,
260         builtin_print,
261         builtin_patom,
262         builtin_plus,
263         builtin_minus,
264         builtin_times,
265         builtin_divide,
266         builtin_mod,
267         builtin_equal,
268         builtin_less,
269         builtin_greater,
270         builtin_less_equal,
271         builtin_greater_equal,
272         builtin_pack,
273         builtin_unpack,
274         builtin_flush,
275         builtin_delay,
276         builtin_led,
277         builtin_save,
278         builtin_restore,
279         _builtin_last
280 };
281
282 typedef ao_poly (*ao_lisp_func_t)(struct ao_lisp_cons *cons);
283
284 extern const ao_lisp_func_t     ao_lisp_builtins[];
285
286 static inline ao_lisp_func_t
287 ao_lisp_func(struct ao_lisp_builtin *b)
288 {
289         return ao_lisp_builtins[b->func];
290 }
291
292 struct ao_lisp_lambda {
293         uint8_t         type;
294         uint8_t         args;
295         ao_poly         code;
296         ao_poly         frame;
297 };
298
299 static inline struct ao_lisp_lambda *
300 ao_lisp_poly_lambda(ao_poly poly)
301 {
302         return ao_lisp_ref(poly);
303 }
304
305 static inline ao_poly
306 ao_lisp_lambda_poly(struct ao_lisp_lambda *lambda)
307 {
308         return ao_lisp_poly(lambda, AO_LISP_OTHER);
309 }
310
311 static inline void *
312 ao_lisp_poly_other(ao_poly poly) {
313         return ao_lisp_ref(poly);
314 }
315
316 static inline uint8_t
317 ao_lisp_other_type(void *other) {
318         return *((uint8_t *) other);
319 }
320
321 static inline ao_poly
322 ao_lisp_other_poly(const void *other)
323 {
324         return ao_lisp_poly(other, AO_LISP_OTHER);
325 }
326
327 static inline int
328 ao_lisp_size_round(int size)
329 {
330         return (size + 3) & ~3;
331 }
332
333 static inline int
334 ao_lisp_size(const struct ao_lisp_type *type, void *addr)
335 {
336         return ao_lisp_size_round(type->size(addr));
337 }
338
339 #define AO_LISP_OTHER_POLY(other) ((ao_poly)(other) + AO_LISP_OTHER)
340
341 static inline int ao_lisp_poly_base_type(ao_poly poly) {
342         return poly & AO_LISP_TYPE_MASK;
343 }
344
345 static inline int ao_lisp_poly_type(ao_poly poly) {
346         int     type = poly & AO_LISP_TYPE_MASK;
347         if (type == AO_LISP_OTHER)
348                 return ao_lisp_other_type(ao_lisp_poly_other(poly));
349         return type;
350 }
351
352 static inline struct ao_lisp_cons *
353 ao_lisp_poly_cons(ao_poly poly)
354 {
355         return ao_lisp_ref(poly);
356 }
357
358 static inline ao_poly
359 ao_lisp_cons_poly(struct ao_lisp_cons *cons)
360 {
361         return ao_lisp_poly(cons, AO_LISP_CONS);
362 }
363
364 static inline int
365 ao_lisp_poly_int(ao_poly poly)
366 {
367         return (int) ((ao_signed_poly) poly >> AO_LISP_TYPE_SHIFT);
368 }
369
370 static inline ao_poly
371 ao_lisp_int_poly(int i)
372 {
373         return ((ao_poly) i << 2) | AO_LISP_INT;
374 }
375
376 static inline char *
377 ao_lisp_poly_string(ao_poly poly)
378 {
379         return ao_lisp_ref(poly);
380 }
381
382 static inline ao_poly
383 ao_lisp_string_poly(char *s)
384 {
385         return ao_lisp_poly(s, AO_LISP_STRING);
386 }
387
388 static inline struct ao_lisp_atom *
389 ao_lisp_poly_atom(ao_poly poly)
390 {
391         return ao_lisp_ref(poly);
392 }
393
394 static inline ao_poly
395 ao_lisp_atom_poly(struct ao_lisp_atom *a)
396 {
397         return ao_lisp_poly(a, AO_LISP_OTHER);
398 }
399
400 static inline struct ao_lisp_builtin *
401 ao_lisp_poly_builtin(ao_poly poly)
402 {
403         return ao_lisp_ref(poly);
404 }
405
406 static inline ao_poly
407 ao_lisp_builtin_poly(struct ao_lisp_builtin *b)
408 {
409         return ao_lisp_poly(b, AO_LISP_OTHER);
410 }
411
412 /* memory functions */
413
414 extern int ao_lisp_collects[2];
415 extern int ao_lisp_freed[2];
416 extern int ao_lisp_loops[2];
417
418 /* returns 1 if the object was already marked */
419 int
420 ao_lisp_mark(const struct ao_lisp_type *type, void *addr);
421
422 /* returns 1 if the object was already marked */
423 int
424 ao_lisp_mark_memory(const struct ao_lisp_type *type, void *addr);
425
426 void *
427 ao_lisp_move_map(void *addr);
428
429 /* returns 1 if the object was already moved */
430 int
431 ao_lisp_move(const struct ao_lisp_type *type, void **ref);
432
433 /* returns 1 if the object was already moved */
434 int
435 ao_lisp_move_memory(const struct ao_lisp_type *type, void **ref);
436
437 void *
438 ao_lisp_alloc(int size);
439
440 #define AO_LISP_COLLECT_FULL            1
441 #define AO_LISP_COLLECT_INCREMENTAL     0
442
443 int
444 ao_lisp_collect(uint8_t style);
445
446 void
447 ao_lisp_cons_stash(int id, struct ao_lisp_cons *cons);
448
449 struct ao_lisp_cons *
450 ao_lisp_cons_fetch(int id);
451
452 void
453 ao_lisp_string_stash(int id, char *string);
454
455 char *
456 ao_lisp_string_fetch(int id);
457
458 void
459 ao_lisp_poly_stash(int id, ao_poly poly);
460
461 ao_poly
462 ao_lisp_poly_fetch(int id);
463
464 /* cons */
465 extern const struct ao_lisp_type ao_lisp_cons_type;
466
467 struct ao_lisp_cons *
468 ao_lisp_cons_cons(ao_poly car, struct ao_lisp_cons *cdr);
469
470 extern struct ao_lisp_cons *ao_lisp_cons_free_list;
471
472 void
473 ao_lisp_cons_free(struct ao_lisp_cons *cons);
474
475 void
476 ao_lisp_cons_print(ao_poly);
477
478 void
479 ao_lisp_cons_patom(ao_poly);
480
481 int
482 ao_lisp_cons_length(struct ao_lisp_cons *cons);
483
484 /* string */
485 extern const struct ao_lisp_type ao_lisp_string_type;
486
487 char *
488 ao_lisp_string_copy(char *a);
489
490 char *
491 ao_lisp_string_cat(char *a, char *b);
492
493 ao_poly
494 ao_lisp_string_pack(struct ao_lisp_cons *cons);
495
496 ao_poly
497 ao_lisp_string_unpack(char *a);
498
499 void
500 ao_lisp_string_print(ao_poly s);
501
502 void
503 ao_lisp_string_patom(ao_poly s);
504
505 /* atom */
506 extern const struct ao_lisp_type ao_lisp_atom_type;
507
508 extern struct ao_lisp_atom      *ao_lisp_atoms;
509 extern struct ao_lisp_frame     *ao_lisp_frame_global;
510 extern struct ao_lisp_frame     *ao_lisp_frame_current;
511
512 void
513 ao_lisp_atom_print(ao_poly a);
514
515 struct ao_lisp_atom *
516 ao_lisp_atom_intern(char *name);
517
518 ao_poly *
519 ao_lisp_atom_ref(struct ao_lisp_frame *frame, ao_poly atom);
520
521 ao_poly
522 ao_lisp_atom_get(ao_poly atom);
523
524 ao_poly
525 ao_lisp_atom_set(ao_poly atom, ao_poly val);
526
527 /* int */
528 void
529 ao_lisp_int_print(ao_poly i);
530
531 /* prim */
532 void
533 ao_lisp_poly_print(ao_poly p);
534
535 void
536 ao_lisp_poly_patom(ao_poly p);
537
538 int
539 ao_lisp_poly_mark(ao_poly p, uint8_t note_cons);
540
541 /* returns 1 if the object has already been moved */
542 int
543 ao_lisp_poly_move(ao_poly *p, uint8_t note_cons);
544
545 /* eval */
546
547 void
548 ao_lisp_eval_clear_globals(void);
549
550 int
551 ao_lisp_eval_restart(void);
552
553 ao_poly
554 ao_lisp_eval(ao_poly p);
555
556 ao_poly
557 ao_lisp_set_cond(struct ao_lisp_cons *cons);
558
559 /* builtin */
560 void
561 ao_lisp_builtin_print(ao_poly b);
562
563 extern const struct ao_lisp_type ao_lisp_builtin_type;
564
565 /* Check argument count */
566 ao_poly
567 ao_lisp_check_argc(ao_poly name, struct ao_lisp_cons *cons, int min, int max);
568
569 /* Check argument type */
570 ao_poly
571 ao_lisp_check_argt(ao_poly name, struct ao_lisp_cons *cons, int argc, int type, int nil_ok);
572
573 /* Fetch an arg (nil if off the end) */
574 ao_poly
575 ao_lisp_arg(struct ao_lisp_cons *cons, int argc);
576
577 char *
578 ao_lisp_args_name(uint8_t args);
579
580 /* read */
581 extern struct ao_lisp_cons      *ao_lisp_read_cons;
582 extern struct ao_lisp_cons      *ao_lisp_read_cons_tail;
583 extern struct ao_lisp_cons      *ao_lisp_read_stack;
584
585 ao_poly
586 ao_lisp_read(void);
587
588 /* rep */
589 ao_poly
590 ao_lisp_read_eval_print(void);
591
592 /* frame */
593 extern const struct ao_lisp_type ao_lisp_frame_type;
594
595 #define AO_LISP_FRAME_FREE      4
596
597 extern struct ao_lisp_frame     *ao_lisp_frame_free_list[AO_LISP_FRAME_FREE];
598
599 ao_poly
600 ao_lisp_frame_mark(struct ao_lisp_frame *frame);
601
602 ao_poly *
603 ao_lisp_frame_ref(struct ao_lisp_frame *frame, ao_poly atom);
604
605 struct ao_lisp_frame *
606 ao_lisp_frame_new(int num);
607
608 void
609 ao_lisp_frame_free(struct ao_lisp_frame *frame);
610
611 int
612 ao_lisp_frame_add(struct ao_lisp_frame **frame, ao_poly atom, ao_poly val);
613
614 void
615 ao_lisp_frame_print(ao_poly p);
616
617 /* lambda */
618 extern const struct ao_lisp_type ao_lisp_lambda_type;
619
620 struct ao_lisp_lambda *
621 ao_lisp_lambda_new(ao_poly cons);
622
623 void
624 ao_lisp_lambda_print(ao_poly lambda);
625
626 ao_poly
627 ao_lisp_lambda(struct ao_lisp_cons *cons);
628
629 ao_poly
630 ao_lisp_lexpr(struct ao_lisp_cons *cons);
631
632 ao_poly
633 ao_lisp_nlambda(struct ao_lisp_cons *cons);
634
635 ao_poly
636 ao_lisp_macro(struct ao_lisp_cons *cons);
637
638 ao_poly
639 ao_lisp_lambda_eval(void);
640
641 /* save */
642
643 ao_poly
644 ao_lisp_save(struct ao_lisp_cons *cons);
645
646 ao_poly
647 ao_lisp_restore(struct ao_lisp_cons *cons);
648
649 /* error */
650
651 extern const struct ao_lisp_type ao_lisp_stack_type;
652
653 void
654 ao_lisp_stack_print(void);
655
656 ao_poly
657 ao_lisp_error(int error, char *format, ...);
658
659 /* debugging macros */
660
661 #if DBG_EVAL
662 #define DBG_CODE        1
663 int ao_lisp_stack_depth;
664 #define DBG_DO(a)       a
665 #define DBG_INDENT()    do { int _s; for(_s = 0; _s < ao_lisp_stack_depth; _s++) printf("  "); } while(0)
666 #define DBG_IN()        (++ao_lisp_stack_depth)
667 #define DBG_OUT()       (--ao_lisp_stack_depth)
668 #define DBG_RESET()     (ao_lisp_stack_depth = 0)
669 #define DBG(...)        printf(__VA_ARGS__)
670 #define DBGI(...)       do { DBG("%4d: ", __LINE__); DBG_INDENT(); DBG(__VA_ARGS__); } while (0)
671 #define DBG_CONS(a)     ao_lisp_cons_print(ao_lisp_cons_poly(a))
672 #define DBG_POLY(a)     ao_lisp_poly_print(a)
673 #define OFFSET(a)       ((a) ? (int) ((uint8_t *) a - ao_lisp_pool) : -1)
674 #define DBG_STACK()     ao_lisp_stack_print()
675 static inline void
676 ao_lisp_frames_dump(void)
677 {
678         struct ao_lisp_stack *s;
679         DBGI(".. current frame: "); DBG_POLY(ao_lisp_frame_poly(ao_lisp_frame_current)); DBG("\n");
680         for (s = ao_lisp_stack; s; s = ao_lisp_poly_stack(s->prev)) {
681                 DBGI(".. stack frame: "); DBG_POLY(s->frame); DBG("\n");
682         }
683 }
684 #define DBG_FRAMES()    ao_lisp_frames_dump()
685 #else
686 #define DBG_DO(a)
687 #define DBG_INDENT()
688 #define DBG_IN()
689 #define DBG_OUT()
690 #define DBG(...)
691 #define DBGI(...)
692 #define DBG_CONS(a)
693 #define DBG_POLY(a)
694 #define DBG_RESET()
695 #define DBG_STACK()
696 #define DBG_FRAMES()
697 #endif
698
699 #define DBG_MEM         0
700 #define DBG_MEM_START   1
701
702 #if DBG_MEM
703
704 #include <assert.h>
705 extern int dbg_move_depth;
706 #define MDBG_DUMP 1
707 #define MDBG_OFFSET(a)  ((int) ((uint8_t *) (a) - ao_lisp_pool))
708
709 extern int dbg_mem;
710
711 #define MDBG_DO(a)      a
712 #define MDBG_MOVE(...) do { if (dbg_mem) { int d; for (d = 0; d < dbg_move_depth; d++) printf ("  "); printf(__VA_ARGS__); } } while (0)
713 #define MDBG_MORE(...) do { if (dbg_mem) printf(__VA_ARGS__); } while (0)
714 #define MDBG_MOVE_IN()  (dbg_move_depth++)
715 #define MDBG_MOVE_OUT() (assert(--dbg_move_depth >= 0))
716
717 #else
718
719 #define MDBG_DO(a)
720 #define MDBG_MOVE(...)
721 #define MDBG_MORE(...)
722 #define MDBG_MOVE_IN()
723 #define MDBG_MOVE_OUT()
724
725 #endif
726
727 #endif /* _AO_LISP_H_ */