add `nil?' primitive
authorBT Templeton <bpt@hcoop.net>
Thu, 16 Jun 2011 00:21:28 +0000 (20:21 -0400)
committerBT Templeton <bpt@hcoop.net>
Fri, 3 Feb 2012 23:53:38 +0000 (18:53 -0500)
commit9348168ed53d1d24a4936e384c04da45d5c89b4f
treed9c0a869d6b336ae9c893c969fe9d48a49274e44
parent6937c7aa8b36037a546e0825fafc933dbd5cf90b
add `nil?' primitive

* libguile/boolean.c (scm_nil_p): New function.

* libguile/vm-i-scheme.c (nilp, not_nilp):
* libguile/vm-i-system.c (br_if_nil, br_if_not_nil): New instructions.
  Renumber other ops.

* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Increment.

* module/language/assembly/compile-bytecode.scm (compile-bytecode): Add
  support for writing `br-if-nil' and `br-if-not-nil' instructions.

* module/language/assembly/disassemble.scm (code-annotation): Add
  `br-if-nil' and `br-if-not-nil' to the list of branch instructions.

* module/language/tree-il/compile-glil.scm: Add `nil?' to
  `*primcall-ops*'.
  (flatten): Use the new branch instructions for `nil?' conditionals.

* module/language/tree-il/primitives.scm: Add `nil?' to
  `*interesting-primitive-names*', `*effect-free-primitives', and
  `*effect+exception-free-primitives*'.
libguile/_scm.h
libguile/boolean.c
libguile/vm-i-scheme.c
libguile/vm-i-system.c
module/language/assembly/compile-bytecode.scm
module/language/assembly/disassemble.scm
module/language/tree-il/compile-glil.scm
module/language/tree-il/primitives.scm