s7_define_function returns an unsafe function (there's
s7_define_safe_function
for the safe case), but s7_define_typed_function returns a safe
function. This
inconsistency arose a long time ago when I noticed that all but a
handful of
the functions in Snd were safe, and it seemed odd to keep saying "safe"
everywhere. Now I wish I had made some other choice. It would be
possible
to remove all the clutter by exporting a function that sets the safe
bit;
maybe that's the way to clean this up -- assume unsafe etc. This issue
came up earlier, and I thought I had found a way to notice in s7 that a
function declared safe was calling something unsafe and warn the user
(s7_eval,
s7_apply_function, s7_values, and s7_eval_c_string are the culprits),
but
it turned out to be tricky to trap that case and not also trap innocuous
cases involving calling eval (etc) in scheme. s7-ffi.html under
"optimization"
has some discussion of this. s7.h includes
s7_define_unsafe_typed_function.
s7_symbol_set_initial_value sets the #_<name> value, so user-defined
functions have that option in hygienic macros and the like.
_______________________________________________
Cmdist mailing list
[email protected]
https://cm-mail.stanford.edu/mailman/listinfo/cmdist