Something went wrong. Try again.
Pattern matching defined computation
Something went wrong. Try again.
257 B · 11 lines · Created 8mo ago
123456789101112#lang rhombus/static
// we can use `matches` to check the shape of datum[1, 2] matches [_, _] // #true[1, 2] matches [_, _, _] // #false
// itself can be a placeholder to indicate an abstraction!def sum = (_ + _)sum(1, 2) // 3
[1, 2, 3].map((_ * 2))