set_fn is annoying because 99% of the time you end up retyping the name of the function.
ctx.set_fn("add", free_fn("add", ...));
The current behavior could be useful if you wanted to have the name of a function be different from the name that it's bound to in the environment, but I don't see this happening very much at all.
add_fn would simply extract the name from the name that is already stored in the ForeignFunction.
set_fn
is annoying because 99% of the time you end up retyping the name of the function.The current behavior could be useful if you wanted to have the name of a function be different from the name that it's bound to in the environment, but I don't see this happening very much at all.
add_fn
would simply extract the name from the name that is already stored in theForeignFunction
.