[eclipse-users] Strange behaviour with attributes.

From: Malcolm Ryan <malcolmr_at_cse.unsw.edu.au>
Date: Mon, 26 Mar 2007 15:00:58 +1000
The following code behaves very strangely for me. When you run  
'test', it prints.

c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(...))))))))))))))))))))

but if you uncomment the line 'true', it prints:

c(X)

I've pruned this down to the simplest example I can find. I have no  
idea why it is doing this.

Malcolm

:- meta_attribute(a, []).
:- meta_attribute(b, []).

:- local struct(c(foo)).

test(X{b:B}) ?-
	% true,			% uncomment this line to change the behaviour
	A = c{foo:X},

	writeln(A),
	add_attribute(Y, A, a).
	
test :-
	add_attribute(X, 1, b),
	test(X).


--
       "An inconvenience is only an adventure wrongly considered;
        an adventure is an inconvenience rightly considered."
                 - G.K.Chesterton, On Running After Ones Hat
Received on Mon Mar 26 2007 - 06:01:12 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:57 CET