]> Repositorios git - scryer-prolog.git/commitdiff
adapt libraries and toplevel output to Scryer Prolog
authorMarkus Triska <[email protected]>
Thu, 25 Feb 2021 21:06:09 +0000 (22:06 +0100)
committerMarkus Triska <[email protected]>
Thu, 25 Feb 2021 21:08:25 +0000 (22:08 +0100)
src/lib/lambda.pl

index 03d9db89d0171d16cda7692f2d66ed09e8f6ce17..56332255336e750f37d35899af50d945bdc7a34f 100644 (file)
@@ -40,6 +40,8 @@ official policies, either expressed or implied, of Ulrich Neumerkel.
                   (+\)/2, (+\)/3, (+\)/4, (+\)/5, (+\)/6, (+\)/7, (+\)/8,
                        (+\)/9, op(201,xfx,+\)]).
 
+:- use_module(library(iso_ext)).
+
 /** <module> Lambda expressions
 
 This library provides lambda expressions to simplify higher order
@@ -70,10 +72,10 @@ In the following example the parentheses around X>3 are necessary.
 
 ==
 ?- use_module(library(lambda)).
-?- use_module(library(apply)).
+?- use_module(library(lists)).
 
 ?- maplist(\X^(X>3),[4,5,9]).
-true.
+   true.
 ==
 
 In the following X is a variable that is shared by both instances of
@@ -82,15 +84,14 @@ continuations and lambdas. The lambda expression is in this case a
 continuation expecting a further argument.
 
 ==
+?- use_module(library(dif)).
+   true.
+
 ?- Xs = [A,B], maplist(X+\Y^dif(X,Y), Xs).
-Xs = [A, B],
-dif(X, A),
-dif(X, B).
+   Xs = [A,B], dif:dif(X,A), dif:dif(X,B).
 
 ?- Xs = [A,B], maplist(X+\dif(X), Xs).
-Xs = [A, B],
-dif(X, A),
-dif(X, B).
+   Xs = [A,B], dif:dif(X,A), dif:dif(X,B).
 ==
 
 The following queries are all equivalent. To see this, use
@@ -103,8 +104,7 @@ the fact f(x,y).
 ?- call(call(f, A1),A2).
 ?- call(f(A1),A2).
 ?- f(A1,A2).
-A1 = x,
-A2 = y.
+   A1 = x, A2 = y.
 ==
 
 Further discussions