mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-05 17:20:18 +02:00
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.
This commit is contained in:
parent
5cfb903459
commit
7f9041c80c
5 changed files with 90 additions and 13 deletions
|
@ -145,6 +145,10 @@ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
|
|||
err_msg = scm_from_locale_string ("VM: Unbound variable: ~s");
|
||||
goto vm_error;
|
||||
|
||||
vm_error_unbound_fluid:
|
||||
err_msg = scm_from_locale_string ("VM: Unbound fluid: ~s");
|
||||
goto vm_error;
|
||||
|
||||
vm_error_apply_to_non_list:
|
||||
scm_error (scm_arg_type_key, "apply", "Apply to non-list: ~S",
|
||||
finish_args, finish_args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue