Skip to content

Conversation

@jackbackrack
Copy link
Contributor

More powerful pattern matcher. It supports

  • pattern variables: ?x and optionally with types: ?x:Int
  • tuple patterns: [?x]
  • struct patterns: Person(?age:Int)
  • arbitrary nesting: Family(Person(?age1:Int), Person(?age2:Int))
  • repeated matching: Family(?p:Person ...)
  • extra predicate expression constraint: ?x:Int and x < 10

It uses a multi in core called destruct-values which is automatically defined in defstruct to return a tuple of the complete field values. Users can define their own defstruct-values methods. Core defines one for sequable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant