AngouriMath

Navigation

← Back to list of members

SetOperator

 Property

Summary

SetOperatorRules(AngouriMath.Entity), as data.

Remarks

The set that was expected to need something the matcher does not have, and did not.
Two things were in doubt. An Interval has four children where
every other node pattern here has one or two — and it turns out a node pattern is not
limited to two, so the arity was never the question; the rule binds the interval whole
anyway, because its replacement wants the node rather than its parts.
The other was real, and was the first limitation of the matcher this file had to
work around.
{ x : x in S } is S, and the switch says that by
deconstructing ConditionalSet(var v, Inf(var v, var s)) — a record
deconstruction, which reads the storedVar and Predicate. The
matcher walked DirectChildren, and a ConditionalSet has
one child there, its predicate, with the bound variable already renamed to a
placeholder: { x : x in [0; 1] } offers %1 in [0; 1] and nothing else.
So the rule bound the whole set and took it apart in its replacement — honest rather
than clever, but a rule whose shape was code again.
It is data now. MatchPattern.Binder reads a binder's declared parts, and the
repeated hole is what the switch wrote as when v1 == v1a. Only this node
type needed it: every other binder in the language publishes the name it binds as an
ordinary child.
#1074

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online