Skip to main content

TypeConverterFun

A function type used for converting values between different types.

TypeConverterFun represents a callable that takes a Boxed_Value of one type and converts it to a Boxed_Value of another type. These functions are used by the type conversion system to enable automatic conversions between compatible types during function dispatch and assignment operations. Custom type converters can be registered using add_type_conversion to extend the type system's conversion capabilities.

Example


// Example type converter function
var int_string_converter = fun(bv) {
return string(bv);
}

// Register the converter
add_type_conversion(type("integer"), type("string"), int_string_converter)