[][src]Module rust_lisp::utils

Functions

require_float_parameter

Given a Value assumed to be a Value::List(), grab the item at index, assumed to be a Value::Float(), and return its inner f32. Err if any part of this fails.

require_int_parameter

Given a Value assumed to be a Value::List(), grab the item at index, assumed to be a Value::Int(), and return its inner i32. Err if any part of this fails.

require_list_parameter

Given a Value assumed to be a Value::List(), grab the item at index, assumed to be a Value::List() or a Value::Nil, erring if that isn't the case.

require_parameter

Given a Value assumed to be a Value::List(), grab the item at index and err if there isn't one.

require_string_parameter

Given a Value assumed to be a Value::List(), grab the item at index, assumed to be a Value::String(), and return a reference to its inner String. Err if any part of this fails.

vec_refs_to_cons

Same as vec_to_cons() but takes a &Vec<&Value> instead.

vec_to_cons

Convert a &Vec to a cons list (Value::List()) containing the sequence of values from the Vec.