July 12, 2020
3:15 a.m.
On 11/07/2020 20:13, Eric Nieuwland wrote:
Just after I hit ‘send’ it dawned on me it might be preferable to make that
match poly: p0 = Point(x0, y0) p1 = Point(x1, y1) p2 = Point(x2, y2) case Polygon(p0, p1, p2): …
so the part preceded by ‘match’ is the preparation phase for matching.
Are you intending p0, p1 and p2 to be subpatterns rather than object instantiations? That makes me a little twitchy; the difference between what you wrote and: match poly: p0 = Point(x0, y0) p1 = Point(x1, y1) case Polygon(p0, p1, p2): ... is very easy to miss. -- Rhodri James *-* Kynesim Ltd