Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
:- object(value_capture).
|
||||
|
||||
:- public(show/0).
|
||||
show :-
|
||||
integer::sequence(1, 10, List),
|
||||
meta::map(create_closure, List, Closures),
|
||||
meta::map(call_closure, List, Closures).
|
||||
|
||||
create_closure(Index, [Double]>>(Double is Index*Index)).
|
||||
|
||||
call_closure(Index, Closure) :-
|
||||
call(Closure, Result),
|
||||
write('Closure '), write(Index), write(' : '), write(Result), nl.
|
||||
|
||||
:- end_object.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
| ?- value_capture::show.
|
||||
Closure 1 : 1
|
||||
Closure 2 : 4
|
||||
Closure 3 : 9
|
||||
Closure 4 : 16
|
||||
Closure 5 : 25
|
||||
Closure 6 : 36
|
||||
Closure 7 : 49
|
||||
Closure 8 : 64
|
||||
Closure 9 : 81
|
||||
Closure 10 : 100
|
||||
yes
|
||||
Loading…
Add table
Add a link
Reference in a new issue