On 4 Aug 2020, at 14:38, Koos Zevenhoven wrote:
Hi everyone,
[ … analysis of design goals and possible solutions, including … ]
Point3D(x=pi, y=SIX, z=value)
It suddenly struck me that Point3D(x=pi, y=SIX, z into value) would quite accurately describe what is being established here.
[ … goes on … ]
<expression> matches <pattern>
and that would evaluate to a boolean-like value.
Yes. I’d like that as it separates functionality (pattern matching) from the control structure (match statement).
[ … ]
Similarly, also point matches main_diagonal_point(pos?) should only match if x == y == z — and then bind that value to pos. However, one might expect to be able to write the same thing inline as point matches Point3D(pos?, pos?, pos?) , so based on that, multiple occurrences of the same binding target should ensure equality.
What about wildcards? If ? were the wildcard, that would mean that point matches main_diagonal_point(?) should NOT mean the same as point matches Point3D(?,?,?)
[ … ]
Clever observations!
—Koos
—eric