mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
* docs: Generates HTML docs for Function core module * docs: Adds lifetime information in Function module * docs: Adds callback section to C Interop * docs: Corrects typos in Function docs
17 lines
846 B
Plaintext
17 lines
846 B
Plaintext
(defmodule Function
|
|
(doc unsafe-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.")
|
|
(deftemplate unsafe-ptr (Fn [(Ref a)] (Ptr ())) "void* $NAME($a *fn)" "$DECL { return fn->callback; }")
|
|
|
|
(doc unsafe-env-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.")
|
|
(deftemplate unsafe-env-ptr (Fn [(Ref a)] (Ptr ())) "void* $NAME($a *fn)" "$DECL { return fn->env; }"))
|