[m-rev.] for review: further polymorphism stuff

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Jan 11 12:30:28 AEDT 2007


On Thu, 11 Jan 2007, Mark Brown wrote:

> On 09-Jan-2007, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>>
>> For review by Mark.
>>
>> Estimated hours taken: 3
>> Branches: main
>>
>> During the initial stage of the polymorphism transformation maintain
>> a more strict separation between the modes for the different kinds
>> of introduced arguments.
>>
>> Add a new data structure to do this.  The new data structure is called a
>> poly_arg_vector, which is similar to a proc_arg_vector but is intended to
>> represent only those arguments that have been introduced by polymorphism.
>> The new data structure is implemented as a proc_arg_vector in order to
>> ensure that the calling convention is consistent across both structure.
>
> An alternative would be to have poly_arg_vector hold the first six fields
> of proc_arg_vector, and for proc_arg_vector to contain a poly_arg_vector.
>
> Perhaps we can discuss this in person tomorrow?

Mark and I have discussed this.  The reason for not having the 
poly_arg_vectors as a separate data structure are:

* the change to introduce proc_arg_vectors into the rest of the HLDS adds
   a large number of higher-order operations that work over proc_arg_vectors.
   If the poly_arg_vectors were a separate data structure it would mean that
   we would need to define all versions of all these higher-order operations
   for poly_arg_vectors as well as proc_arg_vectors.

* in my view the extra level of indirection this would introduce into the
   proc_arg_vector would complicate code that needs to manipulate it.

I intend to stick with the current design for now; if the need arises
changing to the alternative design outlined above should be trivial.

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