Bug fix: Prolog version of builtin_aggregate
Thomas Charles CONWAY
conway at cs.mu.oz.au
Mon Oct 6 15:14:33 AEST 1997
Hi
The following diff adds a definition of builtin_aggregate for
Prolog.
--
ZZ:wq!
^X^C
Thomas Conway conway at cs.mu.oz.au
AD DEUM ET VINUM Every sword has two edges.
library/std_util.m:
Add a definition of builtin_aggregate for Prolog.
cvs diff: Diffing .
Index: std_util.nu.nl
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/std_util.nu.nl,v
retrieving revision 1.15
diff -u -r1.15 std_util.nu.nl
--- std_util.nu.nl 1997/07/27 15:07:18 1.15
+++ std_util.nu.nl 1997/10/06 02:45:31
@@ -76,6 +76,12 @@
%-----------------------------------------------------------------------------%
+builtin_aggregate(P, A, Acc0, Acc) :-
+ findall(X, call(P, X), L),
+ list__foldl(A, L, Acc0, Acc).
+
+%-----------------------------------------------------------------------------%
+
% This is buggy in the backwards mode, but it will just have to do for
% the moment.
More information about the developers
mailing list