Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
go =>
|
||||
println("Function: Use apply/n"),
|
||||
Fun = "fib",
|
||||
A = 10,
|
||||
% Convert F to an atom
|
||||
println(apply(to_atom(Fun),A)),
|
||||
nl,
|
||||
|
||||
println("Predicate: use call/n"),
|
||||
Pred = "pyth",
|
||||
call(Pred.to_atom,3,4,Z),
|
||||
println(z=Z),
|
||||
|
||||
% Pred2 is an atom so it can be used directly with call/n.
|
||||
Pred2 = pyth,
|
||||
call(Pred.to_atom,13,14,Z2),
|
||||
println(z2=Z2),
|
||||
|
||||
nl.
|
||||
|
||||
% A function
|
||||
fib(1) = 1.
|
||||
fib(2) = 1.
|
||||
fib(N) = fib(N-1) + fib(N-2).
|
||||
|
||||
% A predicate
|
||||
pyth(X,Y,Z) =>
|
||||
Z = X**2 + Y**2.
|
||||
Loading…
Add table
Add a link
Reference in a new issue