Option型
import std/options proc compute(opt: Option[int]): string = opt.map(proc (x: int): string = "The value is: " & $x).get("No value") let full = some(42) empty = none(int) echo "compute(full) -> ", compute(full) echo "compute(empty) -> ", compute(empty)