{"id":"word--with","name":"with","owner":"yeho","package":"language","kind":"keyword","signature":"with","description":"Bind a match payload","context":"Use an enum when the valid states are finite and you want the compiler and reader to see every named possibility.","parameters":[],"returns":"","members":[],"tags":["cpu","keyword","language","logic","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"parser_declarations.cpp parseEnumDecl; parser_statements.cpp parseMatchStatement; conformance payload-enum-patterns"},"status":"experimental","notes":["Plain enums are stable enough for ordinary use; richer payload matching remains experimental across targets.","The removed choice spelling is not accepted. Use enum."],"examples":[{"id":"complete","title":"Complete program","description":"Bind the explanation carried by a failed result and display it.","code":"enum Result\n{\n    Ready,\n    Failed(text reason)\n}\nResult result = Result.Failed(\"The player name is missing\")\nmatch result\n{\n    Result.Ready { Console.Log(\"Ready\") }\n    Result.Failed with reason { Console.Log(reason) }\n    else { Console.Log(\"Unknown result\") }\n}\n","tags":["cpu","language"],"run":"cpu-oracle","expected":null,"verifyRun":false,"manifest":"manifestVersion = \"2\"\npackage = \"api.example.word__with\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n","verification":"type checked","sha256":"dec09e229ca3ed94b277ae88887d52eed4611e984171078f345e6c1e82aa7b05","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=word--with","json":"https://demonhunterlabs.com/reference/items/word--with.json","markdown":"https://demonhunterlabs.com/reference/text/word--with.md"}
