{"id":"language--tuples","name":"Tuples and deconstruction","owner":"yeho","package":"language","kind":"language","signature":"tuple of Type, Type\ntuple(value, value)\ndeconstruct value into first, second","description":"Tuple values are an opt-in experiment, gated by tuple-values, and currently run only through generated C++.","context":"Prefer a named thing when the values have domain meaning. Use tuples only for deliberate compiler research behind the feature gate.","parameters":[],"returns":"","members":[],"tags":["boundaries","complete-program","cpu","deconstruct","into","language","of","tuple","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"advanced-features-2026.1.json; tests/compiler/experiments/tuple-opt-in/start.yh"},"status":"generated-cpp-only","notes":["Requires the tuple-values project gate.","The fallback is a named thing with fields that preserve meaning."],"examples":[{"id":"complete","title":"Tuple opt in","description":"Prefer a named thing when the values have domain meaning. Use tuples only for deliberate compiler research behind the feature gate.","code":"SplitScore(text name, int score) returns tuple of text, int\n{\n    return tuple(name, score)\n}\n\ntuple of text, int pair = SplitScore(\"Ava\", 7)\ndeconstruct pair into player, score\nConsole.Log(player)\nConsole.Log(Text.From(score))\n","manifest":"package = \"tests.compiler.experiments.tupleOptIn\"\nversion = \"0.1.0\"\nbackend = \"cpu-oracle\"\nexperiments = [\"tuple-values\"]\n","tags":["cpu","complete-program"],"verification":"type checked","run":"cpu-oracle","source":"tests/compiler/experiments/tuple-opt-in/start.yh","sha256":"ed1675270f7b1ce0eca0d1e02ff9a6712db27f00913aa24461226736f2dec86b","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=language--tuples","json":"https://demonhunterlabs.com/reference/items/language--tuples.json","markdown":"https://demonhunterlabs.com/reference/text/language--tuples.md"}
