Attached is my work in progress to implement the changes to the CAST() function as proposed by Vik Fearing.CAST(expr AS typename NULL ON ERROR)will use error-safe functions to do the cast of expr, and will return NULL if the cast fails.CAST(expr AS typename DEFAULT expr2 ON ERROR)
will use error-safe functions to do the cast of expr, and will return expr2 if the cast fails.