Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,46 @@
|
|||
go =>
|
||||
N = 10,
|
||||
|
||||
% "direct" test that will fail if not satisfied
|
||||
N < 14,
|
||||
|
||||
% if/then/elseif/else
|
||||
if N < 14 then
|
||||
println("less than 14")
|
||||
elseif N == 14 then
|
||||
println("is 14")
|
||||
else
|
||||
println("not less than 14")
|
||||
end,
|
||||
|
||||
% From Prolog: (condition -> then ; else)
|
||||
( N < 14 ->
|
||||
println("less than 14")
|
||||
;
|
||||
println("not less than 14")
|
||||
),
|
||||
|
||||
% Ret = cond(condition, then, else)
|
||||
println(cond(N < 14, "less than 14", "not less than 14")),
|
||||
|
||||
% as a predicate
|
||||
test_pred(N),
|
||||
|
||||
% as condition in a function's head
|
||||
println(test_func(N)),
|
||||
|
||||
println(ok), % all tests are ok
|
||||
|
||||
nl.
|
||||
|
||||
% as a predicate
|
||||
test_pred(N) ?=>
|
||||
N < 14,
|
||||
println("less than 14").
|
||||
test_pred(N) =>
|
||||
N >= 14,
|
||||
println("not less than 14").
|
||||
|
||||
% condition in function head
|
||||
test_func(N) = "less than 14", N < 14 => true.
|
||||
test_func(_N) = "not less than 14" => true.
|
||||
Loading…
Add table
Add a link
Reference in a new issue