Hi,
I cannot write:
?- bagof( (D.a + D.b) , D = d{ a : 1, b : 2}, L).
ERROR: Arguments are not sufficiently instantiated
ERROR: In:
ERROR: [15] throw(error(instantiation_error,_2682))
ERROR: [12] '<meta-call>'(user:user: ...) <foreign>
ERROR: [11] toplevel_call(user:user: ...) at /usr/local/lib/swipl/boot/toplevel.pl:1317
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
To get this working I introduced this TERM variable.
?- bagof( TERM , ( D = d{ a : 1, b : 2}, TERM = D.a + D.b), L).
D = d{a:1, b:2},
L = [1+2].
I guess this is a bug.
I am using SWI-Prolog (threaded, 64 bits, version 9.2.2).
Thanks in Advance,
Frank Schwidom