Function

provides operations on functions.

unsafe-env-ptr

template

(Fn [(Ref a b)] (Ptr ()))

returns void pointer to the environment captured by a lambda.

This is unsafe as unsafe-env-ptr can't check the value passed in is a function.

It is the responsibility of the caller to ensure that the lifetime of the pointer does not exceed the lifetime of the function it's used on.

unsafe-ptr

template

(Fn [(Ref a b)] (Ptr ()))

returns a void pointer to the function passed in.

This is unsafe as unsafe-ptr can't check the value passed in is a function.

It is the responsibility of the caller to ensure that the lifetime of the pointer does not exceed the lifetime of the function it's used on.