[m-users.] seg fault, 64 bit

Paul Bone paul at bone.id.au
Sun Jun 9 15:47:52 AEST 2013


On Sun, Jun 09, 2013 at 02:47:42PM +1000, Paul Bone wrote:
> 
>     % Outer loop.
> foldl(_, [], !Acc).
> foldl(P, L, !Acc) :-
>     foldl2(100000, P, L, LRest, !Acc),
>     foldl(P, LRest, !Acc).

    % Inner loop, with corrections..
foldl2(_, _, [], [], !Acc).
foldl2(N, P, [X | Xs], Rest, !Acc) :-
    ( N > 0 ->
        P(X, !Acc),
        foldl2(N - 1, P, Xs, Rest, !Acc)
    ;
        Rest = [X | Xs]
    ).



-- 
Paul Bone
http://www.bone.id.au



More information about the users mailing list