You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is often convenient to express a pattern match on an object based only on a single field like
structure Person with
data name.
data age.
data profession.
end
let people = [
Person("Joe", 32, "Carpenter").
Person("Darlene", 26, "Developer").
Person("Peter", 35, "Cook")
]
let cnt = 0.
for Person(*) match age if age > 30 in people do
let cnt = cnt+1.
end
Instead of
for Person(_,age if age > 30,_) in people do...
or
for (x:%Person) if x@age > 30 in people do...
The text was updated successfully, but these errors were encountered:
It is often convenient to express a pattern match on an object based only on a single field like
Instead of
or
The text was updated successfully, but these errors were encountered: