#[define]Expand description
Defines a callable lead function
Please read the full documentation
use interpreter::BufValue;
#[define((
desc: "Prints a variable",
notes: Some("Optional Note"),
params: [
// "my-custom-regex, see example below",
r"\$[a-z0-9_]*" // This is a regex of a lead variable
],
returns: Some("%null"), // %null means that it returns nothing
usage: [
(
desc: "Prints $hello",
code: "print $hello"
)
]
root: Some("MyNewRT"), // This is a method on a RuntimeValue
))]
fn foo(var: &BufValue) {
println!("{}", var.display());
}§Creating a prototype function
You just need to update the root variable
These special values are :-
§returns field
The standardized values are :-
| Value | Description |
|---|---|
%null | Returns Nothing |
@rt:name | Returns the RuntimeValue named name |
int | Int |
u_int | UInt |
F | Float |
S | String |
B | boolean |
Arr | Array |
Obj | Object |
Fa | Faillable |
*ptr | Raw Immutable Pointer |
*m ptr | Raw Mutable Pointer |
JoinHandle | Async Task |
Listener | Returns Listener that can be used to listen for events |
RtRAW | Returns RAWRuntime Values (You shouldn’t return a RawRTValue::PKG and should focus on RuntimeValues ONLY!) |