Merge ssh://192.168.66.221/~vitor/Yap/yap-6.3
This commit is contained in:
21
packages/python/examples/namedtuples.yap
Normal file
21
packages/python/examples/namedtuples.yap
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
:- use_module( library(python) ).
|
||||
|
||||
:- := import( collections ).
|
||||
:- := import( yap ).
|
||||
:- e := yap.'YAPEngine'().
|
||||
|
||||
main :-
|
||||
system_predicate(N/A),
|
||||
args(0,A,L),
|
||||
N := namedtuple( N, L),
|
||||
fail.
|
||||
main :-
|
||||
:= e.call( writeln( 1 ) ).
|
||||
|
||||
args(N, N, []) :- !.
|
||||
args(I0,IF,[AI|Ais]) :-
|
||||
I is I0+1,
|
||||
number_string(I, IS),
|
||||
string_concat("A", IS, AI),
|
||||
args(I, IF, Ais).
|
0
packages/python/examples/untitled
Normal file
0
packages/python/examples/untitled
Normal file
Reference in New Issue
Block a user