[m-dev.] Re: functor and arg break encapsulation
Tyson Richard DOWD
trd at students.cs.mu.oz.au
Tue Feb 11 11:51:38 AEDT 1997
Here's a test case for the problem:
% Test case for eliminating predicates from base_type_infos.
%
% Author: trd
:- module elim_base_type_info.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
:- import_module list, int, std_util, term, map, string.
:- type enum ---> one ; two ; three.
:- type fruit ---> banana(enum).
main -->
{ X = banana(three) },
{ Y = banana(two) },
{ det_arg(X, 1, XArg) },
{ det_arg(Y, 1, YArg) },
(
{ XArg = YArg }
->
io__write_string("same\n")
;
io__write_string("different\n")
).
The result is:
Software error: attempted use of dead predicate
--
Tyson Dowd # Another great idea from the
# people who brought you
trd at .cs.mu.oz.au # Beer Milkshakes!
http://www.cs.mu.oz.au/~trd # Confidence --- Red Dwarf
More information about the developers
mailing list