[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Syntactic sugar idea: Safe use of nil
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 29 Jun 2004 16:58:03 -0300
> For example, what if:
> x = expr?.field
> Were sugar for:
> local var = expr;
> x = expr and expr.field
We can achieve the same effect writing
x = (expr or {}).field
-- Roberto