[m-dev.] for review: enforce namespace restrictions

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Dec 5 12:56:19 AEDT 2000


On 05-Dec-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> +#define do_redo				MR_do_redo
> +#define do_fail				MR_do_fail
> +#define do_reset_hp_fail		MR_do_reset_hp_fail
> +#define do_reset_framevar0_fail		MR_do_reset_framevar0_fail
> +#define do_succeed			MR_do_succeed
> +#define do_not_reached			MR_do_not_reached
> +#define exception_handler_do_fail	MR_exception_handler_do_fail

Putting MR_ prefixes in front of label names is a bad idea, because the name
that must be prefixed with MR is not the user visible name, e.g. do_redo,
but the machine visible name, in this case _entry_do_redo. All your change
did was to make the machine visible name _entry_MR_do_redo.

Worse, you modified the compiler to generate these names, so there is no
way to back out this part of your change without causing problems during
the transition.

Label names can be prefixed with MR_ only by changing the MR_entry macro
in mercury_goto.h, but any such change would require all workspaces to be
recompiled when the change takes effect. This is one reason why I did not
do it during my original change. The other is that most labels are in fact
created by the compiler, not handwritten, so the MR prefix is not appropriate
for them. Yet everything is simpler if all labels have the same prefix.

Zoltan.
--------------------------------------------------------------------------
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