[m-rev.] for review: self rval

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jun 21 11:39:42 AEST 2001


On 21-Jun-2001, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
> +++ compiler/mlds.m	2001/06/20 14:22:42
> @@ -1254,8 +1254,13 @@
>  
>  	;	binop(binary_op, mlds__rval, mlds__rval)
>  
> -	;	mem_addr(mlds__lval).
> +	;	mem_addr(mlds__lval)
>  		% The address of a variable, etc.
> +
> +	;	self.
> +		% The equivalent of the this pointer in C++.  Note that
> +		% this rval is valid iff we are targetting an object
> +		% oriented backend.

I suggest s/this/`this'.
Also the rval is only valid inside instance methods (i.e. functions
which are class members and which have the `per_instance' flag set).

> --- compiler/mlds_to_csharp.m	2001/06/08 09:13:41	1.5
> +write_csharp_rval(self) -->
> +	{ sorry(this_file, "self rval") }.

> Index: compiler/mlds_to_java.m
> +output_rval(self) -->
> +	{ unexpected(this_file, "output_rval: self not supported") }.

Why not just output `this' in these two cases?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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