core: Add some error checking.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sat, 24 Dec 2016 11:10:05 +0000 (12:10 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sat, 24 Dec 2016 11:10:05 +0000 (12:10 +0100)
commite8d8d5c3beacbd340f10cc25e696e6ef7d352ac8
tree561642ee4e1f2a48a1af396b605991c0de9a79da
parentbdeb41e0aedadf71fe4132affaeca49466329057
core: Add some error checking.

* lib.c (length): Return -1 for non-proper lists.
  (error): New function.
  (assert_defined): Use it.
  (check_formals, check_apply): New functions.
* mes.c (car, cdr, set_cdr_x, set_env_x, eval_apply): Add error check.
* srfi/srfi-1.mes (member): New function.
* tests/srfi-1.tests ("member"): New test.
lib.c
mes.c
module/mes/base-0.mes
module/srfi/srfi-1.mes
module/srfi/srfi-1.scm
scripts/repl.mes
tests/srfi-1.test