rfc:default_expression
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
rfc:default_expression [2024/08/29 08:50] – bilge | rfc:default_expression [2024/08/29 21:46] (current) – Added two seconary discussion concerns bilge | ||
---|---|---|---|
Line 141: | Line 141: | ||
===== Discussion ===== | ===== Discussion ===== | ||
- | The greatest concern is the proposed grammar is too permissive and has drawbacks. | + | The greatest concern is the proposed grammar is too permissive and has drawbacks. |
==== Limiting grammar ==== | ==== Limiting grammar ==== | ||
Line 176: | Line 176: | ||
test(new D); // Fatal error: Uncaught TypeError: Unsupported operand types: string + int. | test(new D); // Fatal error: Uncaught TypeError: Unsupported operand types: string + int. | ||
</ | </ | ||
+ | |||
+ | ==== Default as a dummy value ==== | ||
+ | |||
+ | Currently < | ||
==== Defaults as a contract ==== | ==== Defaults as a contract ==== | ||
+ | |||
+ | Some have argued allowing < | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
Line 299: | Line 305: | ||
// Match | // Match | ||
F(match(default) { default => default }) | F(match(default) { default => default }) | ||
+ | |||
+ | // Callable | ||
+ | F((default)-> | ||
// Parens | // Parens |
rfc/default_expression.1724921425.txt.gz · Last modified: 2024/08/29 08:50 by bilge