From f143953302c020a0fd115a0033c9507702988cc7 Mon Sep 17 00:00:00 2001 From: Kevin Millikin Date: Thu, 28 May 2015 16:16:23 +0200 Subject: [PATCH] Use an application of a closure to clarify evaluation order. I think the intent is to ensure that the evaluation order for `.?` is analogous to `.` and for `??` it is analogous to `||`. --- proposal.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proposal.md b/proposal.md index 6c4c5c3..c4d646c 100644 --- a/proposal.md +++ b/proposal.md @@ -118,7 +118,9 @@ ifNullExpression: logicalOrExpression ‘??’ logicalOrExpression ``` -An if-null expression of the form *e1??e2* is equivalent to the expression *e1 == null? e2: e1*. +An if-null expression of the form *e1??e2* is equivalent to the expression +`((x) => x == null ? e2 : x)(e1)` +where *x* is a variable that is not used in *e2*. #### 16.31 Assignable Expressions @@ -141,8 +143,8 @@ assignableSelector: ``` An assignable expression can be conditional or unconditional. -A conditional assignable expression of the form *e1?.identifier* is equivalent to the expression -`e1 == ` **null** `? ` **null** ` : e1.identifier`. +A conditional assignable expression of the form *e?.identifier* is equivalent to the expression +`((x) => x == null ? null : x.identifier)(e)`. An unconditional assignable expression is either: