[m-rev.] For review: more store library procedures for Java

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Feb 9 18:23:40 AEDT 2004


On 09-Feb-2004, James Goddard <goddardjames at yahoo.com> wrote:
> library/store.m:
> 	Define generic_ref as having foreign_type "mercury.store.Ref"
> 
> 	Implement the mercury.store.Ref class.
> 
> 	Implement the following predicates in Java:
> 		new_ref/4
> 		unsafe_ref_value/4
> 		arg_ref/5
> 		new_arg_ref/5
> 		set_ref/4
> 		set_ref_value/4
> 		extract_ref_value/3
> 		unsafe_arg_ref/5
> 		unsafe_new_arg_ref/5

That looks fine, except that (as we discussed) this
Java code isn't doing the same dynamic type checking
that the C code does, and so there should be some XXX
comments about that in the appropriate places,
namely arg_ref/5 and new_arg_ref/5.

For the record, the issue here is that for those procedures,
the C code does a dynamic type check to check that the
value of (the type_info for) the type ArgT supplied by
the caller matches the type of the specified argument
of the term passed in, whereas the Java code does not,
because doing that would require using the RTTI information.

-- 
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