TyOverby / ares

A Lisp made for easy integration with Rust.
9 stars 1 forks source link

Context should have an `add_fn` method #40

Open TyOverby opened 9 years ago

TyOverby commented 9 years ago

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.