unbound fluids
authorBrian Templeton <bpt@hcoop.net>
Sat, 14 Aug 2010 22:35:17 +0000 (18:35 -0400)
committerAndy Wingo <wingo@pobox.com>
Tue, 7 Dec 2010 12:21:01 +0000 (13:21 +0100)
commitef94624eaf549ca9c730d4650b9dfed2ee48521b
tree5cc8343605d2fa9e9aac28bd3328ab71cdb01e7b
parentd1079217947013dac495a95e433ad5da9f7aa80a
unbound fluids

* libguile/fluids.c (scm_make_undefined_fluid, scm_fluid_unset_x)
  (scm_fluid_bound_p): New functions.

  (fluid_ref): New function; like scm_fluid_ref, but will not throw an
  error for unbound fluids.
  (scm_fluid_ref, swap_fluid): Use `fluid_ref'.

* libguile/fluids.h (scm_make_undefined_fluid, scm_fluid_unset_x)
  (scm_fluid_bound_p): New prototypes.

* libguile/vm-i-system.c (fluid_ref): If fluid is unbound, jump to
  `vm_error_unbound_fluid'.
* libguile/vm-engine.c (VM_NAME)[vm_error_unbound_fluid]: New error
  message.

* test-suite/tests/fluids.test ("unbound fluids")["fluid-ref of unbound
  fluid", "fluid-bound? of bound fluid", "fluid-bound? of unbound
  fluid", "unbound fluids can be set", "bound fluids can be unset"]: New
  tests.
libguile/fluids.c
libguile/fluids.h
libguile/vm-engine.c
libguile/vm-i-system.c
test-suite/tests/fluids.test