1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

7 commits

Author SHA1 Message Date
Andy Wingo
133ef660af fix unbound fluid tests
* test-suite/tests/fluids.test: Fix tests.
2010-12-17 13:53:29 +01:00
Brian Templeton
ef94624eaf 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.
2010-12-07 13:21:01 +01:00
Andy Wingo
0abc210944 deprecate @bind
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (@bind): Deprecate @bind, which was a
  thread-unsafe dynamic scoping mechanism, used in the old elisp
  support. Fluids are more correct, and are probably faster, given the
  VM support for with-fluids.

* test-suite/tests/dynamic-scope.test: Remove.
* test-suite/tests/fluids.test: Move relevant tests from
  dynamic-scope.test here, recast in terms of with-fluids.
2010-04-19 14:00:23 +02:00
Ludovic Courtès
c02924d02b Add new fluid tests.
* test-suite/tests/fluids.test ("initial fluid values")["initial value
  is inherited from parent thread"]: New test.
  ("fluid values are thread-local"): New test.
2010-03-05 13:38:57 +01:00
Ludovic Courtès
3278efd3fa Add test checking whether fluids are GC'd.
* test-suite/tests/fluids.test ("fluids are GC'd"): New test.
2010-03-03 00:36:41 +01:00
Andy Wingo
bb0229b51d add with-fluids objects and primitive syntax
* libguile/tags.h (scm_tc7_with_fluids): Allocate a tc7 for
  "with-fluids" objects, which will only live on the dynamic stack (wind
  list), not in normal scheme-land.

* libguile/fluids.h (SCM_WITH_FLUIDS_P, SCM_WITH_FLUIDS_LEN)
  (SCM_WITH_FLUIDS_NTH_FLUID, SCM_WITH_FLUIDS_NTH_VAL)
  (SCM_WITH_FLUIDS_SET_NTH_VAL): Add some accessors.
* libguile/fluids.c (scm_i_make_with_fluids, scm_i_swap_with_fluids):
  New internal functions.
  (scm_c_with_fluids, scm_c_with_fluid): Push with-fluids objects on the
  dynwind list, not winders.

* libguile/dynwind.c (scm_i_dowinds): Add cases for winding and
  unwinding with-fluids objects.

* libguile/memoize.h (scm_sym_with_fluids, SCM_M_BEGIN): New public
  data.
* libguile/memoize.c (scm_m_with_fluids): Define with-fluids as a
  primitive syntax.
  (unmemoize): Add with-fluids case.

* libguile/eval.c (eval):
* module/ice-9/eval.scm (primitive-eval): Add with-fluids cases.

* test-suite/tests/fluids.test
  ("fluids not modified if nonfluid passed to with-fluids"): Enable a
  now-passing test.
2010-02-18 22:15:43 +01:00
Andy Wingo
27bd1deced add fluid tests
* test-suite/Makefile.am:
* test-suite/tests/fluids.test: Add some fluid tests. One is an XFAIL
  right now.
2010-02-18 22:15:43 +01:00