Implement function pointers.

This commit is contained in:
Stephen Chung
2020-06-25 18:07:57 +08:00
parent aeb47efce8
commit fe640e0e13
18 changed files with 269 additions and 31 deletions

View File

@@ -35,6 +35,8 @@ Dynamic
* Organize code base with dynamically-loadable [modules].
* [Function pointers].
Safe
----

View File

@@ -11,10 +11,13 @@ It doesn't attempt to be a new language. For example:
* No traits... so it is also not Rust. Do your Rusty stuff in Rust.
* No structures/records - define your types in Rust instead; Rhai can seamlessly work with _any Rust type_.
There is, however, a built-in [object map] type which is adequate for most uses.
* No first-class functions - Code your functions in Rust instead, and register them with Rhai.
There is, however, support for simple [function pointers] allowing runtime dispatch by function name.
* No garbage collection - this should be expected, so...
* No closures - do your closure magic in Rust instead; [turn a Rhai scripted function into a Rust closure]({{rootUrl}}/engine/call-fn.md).