Skip to main content

rl_lang/docs/entries/stdlib/rl/
eval.rs

1use crate::docs::entry::FnEntry;
2
3pub static EVAL: FnEntry = FnEntry {
4    signature: "eval(code)",
5    description: "parses, resolves, and runs a string of rl source code in the current scope, so it can read and declare variables alongside the calling program; returns everything the code printed",
6    example: "get std::rl::eval\n\ndec int x = 5\neval(\"println(x + 1)\") // ok(\"6\\n\")",
7    expected_output: None,
8    returns: "Result[string]",
9    errors: Some("returns an error message if the code fails to parse, resolve, or run"),
10    see_also: &["eval_isolated", "check"],
11    since: None,
12};