Refine docs and comments etc.

This commit is contained in:
Stephen Chung
2021-01-02 23:30:10 +08:00
parent 5a3bbaa322
commit ef48f47b74
22 changed files with 352 additions and 296 deletions

View File

@@ -149,14 +149,18 @@ change(); // <- error: `this` is unbound
`is_def_fn`
-----------
Use `is_def_fn` to detect if a Rhai function is defined (and therefore callable), based on its name
and the number of parameters.
Use `is_def_fn` to detect if a Rhai function is defined (and therefore callable),
based on its name and the number of parameters.
```rust
fn foo(x) { x + 1 }
is_def_fn("foo", 1) == true;
is_def_fn("foo", 0) == false;
is_def_fn("foo", 2) == false;
is_def_fn("bar", 1) == false;
```