[m-rev.] for review: make deconstruct work for herbrand variables
David Jeffery
dgj at cs.mu.OZ.AU
Wed Jul 11 11:30:24 AEST 2001
On 10-Jul-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > case MR_SECTAG_VARIABLE:
> > - MR_fatal_error(MR_STRINGIFY(EXPAND_FUNCTION_NAME)
> > - ": cannot expand variable");
> > + handle_functor_name("<<variable>>");
> > + handle_zero_arity_args();
> > + return;
>
> You should add `expand_info->non_canonical_type = TRUE;'
> at the start of the case. Because deconstructing a term
> whose inst is unknown and and figuring out whether it is
> ground or not should definitely be cc_multi rather than det.
>
> Oh wait, that will break the debugger gain, since we don't have
> variants of deconstruct (etc.) that allow this. We should add
> such variants, and fix the debugger to call them.
>
> In the mean time, add it, but leave it commented out.
> (Preferably with a comment explaining why.)
I have added the following comment:
/*
** XXX We should do something like the
** following, since deconstructing a value
** that might be a variable should be
** cc_multi rather than det. However, there
** is no such version of deconstruct yet,
** so we'll leave it out.
*/
/*expand_info->non_canonical_type = TRUE;*/
> The "return;" statement there, buried in the middle of a very long function,
> is asking for trouble.
You are right, but in this case I thought it was less of an evil than trying
to escape gracefully from the nested switch.
dgj
--
David Jeffery (dgj at cs.mu.oz.au) | If you want to build a ship, don't drum up
PhD student, | people together to collect wood or assign
Dept. of Comp. Sci. & Soft. Eng.| them tasks and work, but rather teach them
The University of Melbourne | to long for the endless immensity of the sea.
Australia | -- Antoine de Saint Exupery
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list