Same fringe: Difference between revisions

m
→‎{{header|Sidef}}: modified the code to work with the latest version of Sidef
m (Added the Sidef language)
m (→‎{{header|Sidef}}: modified the code to work with the latest version of Sidef)
Line 2,186:
func get_tree_iterator(*rtrees) {
var tree;
closurefunc {
tree = rtrees.pop;
while (defined(tree) && tree.is_an(Array)) {
rtrees.append(tree[1]);
tree = tree[0];
};
return tree;
}
Line 2,201:
loop {
var (L, R) = (ti1(), ti2());
all { defined(L) !=&& nil; defined(R) != nil;&& (L == R }) && next;
all { !defined(L) == nil;&& !defined(R == nil }) && return "Same";
return "Different";
}
Line 2,210:
say ("tree[#{tree_idx-1}] vs tree[#{tree_idx}]: ",
cmp_fringe(trees[tree_idx-1], trees[tree_idx]));
};</lang>
 
{{out}}
2,747

edits