mirror of
https://github.com/AdaCore/uwrap.git
synced 2026-02-12 13:06:34 -08:00
The usage of the word 'self' to refer to the current iteration became increasingly confusing with the usual OOP counterpart, in particular because its value can change in a single expression, independendly of the surrounding object. See previous check in that uncovered its usage in the fold function.
25 lines
644 B
Plaintext
25 lines
644 B
Plaintext
function is_A_entity (e) do
|
|
match e (Entity (f_name ("A"))) do
|
|
pick e;
|
|
else
|
|
pick false;
|
|
end;
|
|
end;
|
|
|
|
function get_two_children (e) do
|
|
pick e.child (f_name (x"B"));
|
|
pick e.child (f_name (x"C"));
|
|
end;
|
|
|
|
function get_B_children (e) do
|
|
pick e.child (f_name (x"B")).all();
|
|
end;
|
|
|
|
match is_A_entity (it) do
|
|
pick get_two_children (it) weave standard.out (@ & "TWO CHILDREN (ONLY FIRST): " & f_name & "\n");
|
|
then
|
|
pick get_two_children (it).all () weave standard.out (@ & "TWO CHILDREN (ALL): " & f_name & "\n");
|
|
then
|
|
pick get_B_children (it).all () weave standard.out (@ & "B CHILDREN (ALL): " & f_name & "\n");
|
|
end;
|