Skip to main content

run_with_fuel

Function run_with_fuel 

Source
pub fn run_with_fuel(source: &str, fuel: Fuel) -> Io<Error, Value>
Expand description

Lex, parse, and evaluate source with a caller-supplied fuel budget.

§Errors

See Error.

§Examples

use lambda_throw_cat::eval::Fuel;
use lambda_throw_cat::run_with_fuel;

let value = run_with_fuel(r"try throw (\x. x) catch e. e", Fuel::new(100)).run()?;
assert_eq!(format!("{value}"), "\\x. x");