[m-dev.] for review: MLDS back-end: add runtime library

Tyson Dowd trd at cs.mu.OZ.AU
Sat Dec 4 12:50:27 AEDT 1999


On 04-Dec-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Hi,
> 
> Tyson, would you mind reviewing this one?

No problem.

> +#define MR_define_base_type_info(module, type, arity, type_rep)		      \
> +									      \
> +	extern MR_special_func_type(Unify, arity)			      \
> +		MR_base_type_info_func_name(module, type, arity, __Unify__);  \
> +	extern MR_special_func_type(Index, arity)			      \
> +		MR_base_type_info_func_name(module, type, arity, __Index__);  \
> +	extern MR_special_func_type(Compare, arity)			      \
> +		MR_base_type_info_func_name(module, type, arity, __Compare__);\
> +									      \
> +	const MR_BaseTypeInfo MR_base_type_info_name(module, type, arity) =   \
> +	{								      \
> +		arity,							      \
> +		(MR_Box) MR_base_type_info_func_name(module, type, arity,     \
> +				__Unify__),				      \
> +		(MR_Box) MR_base_type_info_func_name(module, type, arity,     \
> +				__Index__),				      \
> +		(MR_Box) MR_base_type_info_func_name(module, type, arity,     \
> +				__Compare__),				      \
> +		type_rep,						      \
> +		NULL,							      \
> +		NULL,							      \
> +		MR_STRINGIFY(module),					      \
> +		MR_STRINGIFY(type),					      \
> +		MR_RTTI_VERSION						      \
> +	}
> +
> +MR_define_base_type_info(builtin, int, 0, MR_TYPECTOR_REP_INT);
> +MR_define_base_type_info(builtin, string, 0, MR_TYPECTOR_REP_STRING);
> +MR_define_base_type_info(builtin, float, 0, MR_TYPECTOR_REP_FLOAT);
> +MR_define_base_type_info(builtin, character, 0, MR_TYPECTOR_REP_CHAR);
> +MR_define_base_type_info(builtin, void, 0, MR_TYPECTOR_REP_VOID);
> +MR_define_base_type_info(builtin, c_pointer, 0, MR_TYPECTOR_REP_C_POINTER);
> +MR_define_base_type_info(builtin, pred, 0, MR_TYPECTOR_REP_PRED);
> +MR_define_base_type_info(builtin, func, 0, MR_TYPECTOR_REP_PRED);
> +MR_define_base_type_info(array, array, 1, MR_TYPECTOR_REP_ARRAY);
> +MR_define_base_type_info(std_util, univ, 0, MR_TYPECTOR_REP_UNIV);
> +MR_define_base_type_info(std_util, type_info, 0, MR_TYPECTOR_REP_TYPEINFO);
> +MR_define_base_type_info(private_builtin, type_ctor_info, 1,
> +	MR_TYPECTOR_REP_TYPEINFO);
> +MR_define_base_type_info(private_builtin, type_info, 1,
> +	MR_TYPECTOR_REP_TYPEINFO);
> +MR_define_base_type_info(private_builtin, base_typeclass_info, 1,
> +	MR_TYPECTOR_REP_TYPECLASSINFO);
> +MR_define_base_type_info(private_builtin, typeclass_info, 1,
> +	MR_TYPECTOR_REP_TYPECLASSINFO);

Neat.  We could do with some of these in mercury_type_info.h

Looks fine.

-- 
The quantum sort: 
	while (!sorted) { do_nothing(); }
Tyson Dowd   <tyson at tyse.net>   http://tyse.net/
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list