Why doesn’t Mojo have struct pattern (destructuring)? Just wondering
clattner
(Chris Lattner)
September 20, 2026, 1:38am
2
It is a work in progress that hasn’t fully landed. We aim to get pattern matching (including struct field matching) into the Mojo 1.2 release, but that is just a goal, not a promise
# Mojo Pattern Matching
**Status**: Prototype implementation underway.
Date: Aug 29, 2026
This is a set of notes to braindump thoughts on adding pattern matching to Mojo.
It’s not meant to be canonical or a set of strongly held opinions; it is meant
to help guide further design discussions.
A separate [Enums for Mojo Notes](enums.md) doc builds on the pattern system
described here, but enums are not required to implement or motivate the core
pattern-matching design.
## Introduction
**Pattern matching** is a general mechanism for testing whether a value has a
particular structure and, when it does, extracting pieces of that value into new
bindings. Python has rich support for pattern matching - Mojo should embrace
its existing core syntax, and extend it in ways that are specific to its needs
This file has been truncated. show original