# Does nim have structural pattern matching like this ? import std/strutils let cmd = "go west" case cmd.split(" "): of @["go", @direction]: echo(direction) else: echo("invalid command")