lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: Is everything an expression?
From
: Francisco Olarte <folarte@
...
>
Date
: Thu, 12 Sep 2013 10:08:30 +0200
On Wed, Sep 11, 2013 at 6:10 PM, Andres Perera
<
andres.p@zoho.com
>
wrote:
Almost the same as perl's // operator, except // does not treat nil (undef) the same as false
Typo, it's the perl || operator, in fact // treats ONLY undef as false. This is done so you can apply the idiom when the actual value is '' or 0:
$ perl -MData::Dumper -e 'print Dumper [ 0 || 1, undef ||1, 0//1, undef // 1 ]'
$VAR1 = [
1,
1,
0,
1
];
( Think on the line being applied as '$actual op $default', or as my $value = shift op $default on subroutine entry )
Francisco Olarte.
Follow-Ups
:
Re: Is everything an expression?
,
Mark Hamburg
References
:
Is everything an expression?
,
Musical Notation
Re: Is everything an expression?
,
Jerome Vuarand
Re: Is everything an expression?
,
steve donovan
Re: Is everything an expression?
,
Rena
Re: Is everything an expression?
,
slayer beast
Re: Is everything an expression?
,
Lorenzo Donati
Re: Is everything an expression?
,
Seppl Vorderhörer
Re: Is everything an expression?
,
steve donovan
Re: Is everything an expression?
,
Andres Perera
Prev by Date:
Lice-lua 0.1.1: command-line licence generator
Next by Date:
Re: API documentation for libraries
Previous by thread:
Re: Is everything an expression?
Next by thread:
Re: Is everything an expression?
Index(es):
Date
Thread