core: Add continuations, call/cc.
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 28 Dec 2016 21:04:57 +0000 (22:04 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 28 Dec 2016 21:04:57 +0000 (22:04 +0100)
commitd0f7db73f9bd36223fd5273a10db1f6b110b7890
tree628d9ee253c307169be60b506524a04c607c1694
parentb66cd8627cc64e090f6b9d1614f791a2f3539cd4
core: Add continuations, call/cc.

* mes.c (type_t): Add CONTINUATION.
  (scm_t): Add continuation;
  (scm_call_with_current_continuation): New symbol.
  (scm_symbol_call_with_current_continuation): New special.
  (g_continuations): New global
  (CONTINUATION): New field accessor.
  (MAKE_CONTINUATION): New make_cell helper.
  (car_): Update.
  (eval_apply): Implement call/cc.
* module/mes/display.mes (display): Handle continuations.
* module/mes/type-0.mes (<cell:continuation>): New type.
  (cell-type-alist): Add it.
  (continuation?): New function.
* tests/base.test ("call/cc"): New test.
mes.c
module/mes/base-0.mes
module/mes/base.mes
module/mes/display.mes
module/mes/read-0.mes
module/mes/type-0.mes
tests/base.test