On Fri, Mar 29, 2002 4:36 AM, Gurvan Le Guernic <mailto:address@hidden>
wrote:
instead of typing: append(A,B,L1), append(L1,C,L).
we could type something like: L=A o B o C.
Here is one approach.
If you'd be willing to type: A o B o C o L, where L is the "result" list,
then this can be implemented in standard prolog using an operator.
A possible implementation:
:- op( 900, xfy, o).
o( A, o( B, C)) :- append(A, B, X), o(X, C).
o( X, X) :- X \= o(_, _).
Examples:
'A o B o L.' -> 'append( A, B, L).'
'A o B o C o L.' -> 'append(A, B, X), append(X, C, L).'
-lindsey
_______________________________________________
Users-prolog mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/users-prolog