Algebraic data types: Difference between revisions

m
better link
m (removed omit from phix)
m (better link)
Line 1,084:
something up is likely to be particularly difficult, so let's give it a whirl.
 
Uses a slightly tweaked version of demo\rosetta\VisualiseTree.exw[[Visualize_a_tree#Phix|Visualize_a_tree]], for the full runnable code
see demo\rosetta\Pattern_matching.exw (shipped with 0.8.0+).
 
First, imagine the following is in say algebraic_data_types.e. It is not quite generic enough,
and there are too many little fudges, such as that "and not string(ki)", and the use of 0 for
the "any value", and {} to indicate failure, for it to end up in builtins\ as-is, but not exactly
difficult to copy/maintain on a per-project basis.
<lang Phix>function match_one(sequence key, object t)
7,820

edits