Content deleted Content added
No edit summary |
m idiomatic English here for something that is left to some other aspect is "relegated" not "regulated" |
||
Line 487:
==== Algebraic data types and pattern matching ====
Nim has support for [[Product type|product types]] via the <code>object</code> type, and for [[Sum type|sum types]] via [[Variant type|object variants]]: raw representations of [[Tagged union|tagged unions]], with an enumerated type tag that must be [[Pattern matching|safely matched upon]] before fields of variants can be accessed.<ref>{{Cite web |title=Nim Manual: Object variants |url=https://nim-lang.org/docs/manual.html#types-object-variants |access-date=2023-08-17 |website=nim-lang.org}}</ref> These types can be [[Algebraic data type|composed algebraically]]. [[Structural pattern matching]] is available, but
import std/tables
|