Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,20 @@
go =>
L = 1..10,
% Using map/2 in different ways
println(L.map(fun)),
println(map(L,fun)),
println(map(fun,L)),
% List comprehensions
println([fun(I) : I in L]),
% Using apply/2
println([apply(fun,I) : I in L]),
% And using list comprehension with the function directly.
println([I*I : I in L]),
nl.
% Some function
fun(X) = X*X.

View file

@ -0,0 +1,9 @@
go2 =>
L = 1..10,
% Define the predicate _in the bp space_.
bp.assert( $(fun2(X,Y) :- Y is X*X) ),
% Use bp.fun2 to call the function.
println([B : A in L, bp.fun2(A,B)]),
nl.