[m-dev.] lcmc for high-level data

Zoltan Somogyi zs at csse.unimelb.edu.au
Tue Sep 8 12:53:32 AEST 2009


On 07-Sep-2009, Peter Hawkins <hawkinsp at cs.stanford.edu> wrote:
> Not knowing the specifics of the transformation in question, rather
> than using reflection, couldn't you do add a method to the object
> whose field is to be updated along the lines of:
> 
> void updateField(int field_number, Object o) {
>   switch (field_number) {
>     case 0: this.a = (TypeA)o; break;
>     case 1: this.b = (TypeB)o; break;
>     ...
>   }
> }
> 
> The transformation needs to ensure that the appropriate field number
> is passed from caller to callee together with the object base pointer,
> and the callee should call the updateField method to write to the
> field.

My guess is that Peter Wang was talking about this exact scheme of code
generaton.

Zoltan.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list