phoenix_lang/utils.rs
1use crate::value::Value;
2use crate::vm::VMState;
3
4/// Convert arg to a float and do some error checks (without casting)
5#[deprecated]
6pub fn to_float(arg: &Value) -> Result<f32, String> {
7 arg.to_float()
8}
9
10/// Convert arg to a long and do some error checks (without casting)
11#[deprecated]
12pub fn to_long(arg: &Value) -> Result<i64, String> {
13 arg.to_long()
14}
15
16/// Convert arg to a bool and do some error checks (without casting)
17#[deprecated]
18pub fn to_bool(arg: &Value) -> Result<bool, String> {
19 arg.to_bool()
20}
21
22/// Convert arg to a list and some error checks (without casting)
23#[deprecated]
24pub fn to_list(arg: &Value, state: &VMState) -> Result<Vec<Value>, String> {
25 arg.to_list(state)
26}