savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
157 stars 12 forks source link

Add `static_address_of_function` macro. #292

Closed jemc closed 2 years ago

jemc commented 2 years ago

This macro takes a call type and function name and returns the pointer to that function as a Pointer(None).

It must be a :fun non, and it must have a body defined.

The function pointer is suitable for use with FFI functions that take a callback function pointer. That is, you can define a :fun non function and pass it into a C function that will call it later.