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
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)
|