diff options
author | Keith Packard <keithp@keithp.com> | 2016-11-09 09:14:50 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-11-17 22:18:39 -0800 |
commit | 71796f4407ebf11251c150dfa368f571ba12db8d (patch) | |
tree | 9bdc0d22c719a5745cf8e9632c4f1dd4b316c5d0 /src/lisp/ao_lisp_frame.c | |
parent | 9e58eeb68a293ae94e0672a31a2116fc52c9dd1e (diff) |
altos/lisp: working on lexical scoping
Not working yet
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_frame.c')
-rw-r--r-- | src/lisp/ao_lisp_frame.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lisp/ao_lisp_frame.c b/src/lisp/ao_lisp_frame.c index 8791c4de..7978f20a 100644 --- a/src/lisp/ao_lisp_frame.c +++ b/src/lisp/ao_lisp_frame.c @@ -100,6 +100,27 @@ const struct ao_lisp_type ao_lisp_frame_type = { .move = frame_move }; +void +ao_lisp_frame_print(ao_poly p) +{ + struct ao_lisp_frame *frame = ao_lisp_poly_frame(p); + int f; + + printf ("{"); + if (frame) { + for (f = 0; f < frame->num; f++) { + if (f != 0) + printf(", "); + ao_lisp_poly_print(frame->vals[f].atom); + printf(" = "); + ao_lisp_poly_print(frame->vals[f].val); + } + if (frame->next) + ao_lisp_poly_print(frame->next); + } + printf("}"); +} + ao_poly * ao_lisp_frame_ref(struct ao_lisp_frame *frame, ao_poly atom) { |