Branch: Tag:

2014-02-24

2014-02-24 17:32:13 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added some more type checking functions to the Pike module.

The efuns __soft_cast(), __low_check_call(), __get_return_type(),
__get_first_arg_type() and __get_type_attributes() are now all
available in the Pike module (without their '__' prefixes), and
documented as belonging there.

2454:    free_type(t);   }    - /*! @decl type __soft_cast(type to, type from) + /*! @module Pike +  */ +  + /*! @decl type soft_cast(type to, type from)    *!    *! Return the resulting type from a soft cast of @[from] to @[to].    */
2478:    }   }    - /*! @decl type __low_check_call(type fun_type, type arg_type) -  *! @decl type __low_check_call(type fun_type, type arg_type, int flags) + /*! @decl type low_check_call(type fun_type, type arg_type) +  *! @decl type low_check_call(type fun_type, type arg_type, int flags)    *!    *! Check whether a function of type @[fun_type] may be called    *! with a first argument of type @[arg_type].
2530:    }   }    - /*! @decl type __get_return_type(type fun_type) + /*! @decl type get_return_type(type fun_type)    *!    *! Check what a function of the type @[fun_type] will    *! return if called with no arguments.
2558:    }   }    - /*! @decl type __get_first_arg_type(type fun_type) + /*! @decl type get_first_arg_type(type fun_type)    *!    *! Check if a function of the type @[fun_type] may be called    *! with an argument, and return the type of that argument.
2588:    }   }    - /*! @decl array(string) __get_type_attributes(type t) + /*! @decl array(string) get_type_attributes(type t)    *!    *! Get the attribute markers for a type.    *!
2596:    *! Returns an array with the attributes for the type @[t].    *!    *! @seealso -  *! @[__get_return_type()], @[__get_first_arg_type()] +  *! @[get_return_type()], @[get_first_arg_type()]    */   static void f___get_type_attributes(INT32 args)   {
2622:    stack_pop_n_elems_keep_top(args);   }    + /*! @endmodule Pike +  */ +    /*! @decl mapping (string:mixed) all_constants()    *!    *! Returns a mapping containing all global constants, indexed on the name