[m-rev.] For review: Annotate the HLDS with regions
Julien Fischer
juliensf at csse.unimelb.edu.au
Fri Jun 29 17:33:07 AEST 2007
On Fri, 29 Jun 2007, Quan Phan wrote:
>>> +
>>> + % Instruction is of the form: "Tx: xxxxxx R..."
>>> + % The first x is the number of the rule, which is not important here.
>>> + % The next 6 x is either "remove" or "create", the last part is the
>>> + % region name. This region name will be subjected to renaming due to
>>> + % if-then-else and region resurrection.
>>> + % This predicate turns such an instruction into a call to a suitable
>>> + % region builtin.
>>> + %
>>
>> Instructions should *not* be represented as strings. You're using
>> a strongly-typed language, so use types! e.g.
>>
>> :- type region_instruction
>> ---> region_instruction(
>> ri_rule_num :: int,
>> ri_instr_kindg :: region_op,
>> ri_name :: ???
>> ).
>>
>> :- type region_op
>> ---> region_create
>> ; region_remove.
>>
>> or something along those lines. That would also mean that a lot if
>> the if-then-elses that occur in the following code could be turned into
>> switches.
>>
>
> I agree to use a type for region instructions (we may have more of them in the
> future). What I want to do is to postpone this change a bit after we have a
> runnable system. So I put XXX comment at this place.
> Is that acceptable for now?
Yes.
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list