
use type

+ fn new_null() Value {
    return Value {
        type: type_null
    }
}
+ fn new_bool(value: type:bool) Value {
    return Value {
        type: type_bool
        bool_value: value
    }
}
+ fn new_int(value: type:int) Value {
    return Value {
        type: type_number
        int_value: value
    }
}
+ fn new_uint(value: type:uint) Value {
    return Value {
        type: type_number
        int_value: value.to(type:int)
    }
}
+ fn new_float(value: type:float) Value {
    return Value {
        type: type_number
        float_value: value
    }
}
+ fn new_string(text: String) Value {
    return Value {
        type: type_string
        string_value: text
    }
}
+ fn new_array(values: ?Array[Value] (null)) Value {
    return Value {
        type: type_array
        array_values: values ?? type:Array[Value]{}
    }
}
+ fn new_object(values: ?Map[Value] (null)) Value {
    return Value {
        type: type_object
        object_values: values ?? Map[Value]{}
    }
}
