On Sat, Nov 12, 2016 at 9:47 AM Christoph M. Becker
wrote:
> On 12.11.2016 at 17:21, David Walker wrote:
>
> > Should
> > $a = 1;
> > var_dump(1 < $a++ < 3);
> >
> > (expanded into numbers) be evaluated as:
> > 1 < 2 && 2 < 3 - True
> > or
> > 1 < 2 && 3 < 3 - False
>
> In my
On 12.11.2016 at 17:21, David Walker wrote:
> Should
> $a = 1;
> var_dump(1 < $a++ < 3);
>
> (expanded into numbers) be evaluated as:
> 1 < 2 && 2 < 3 - True
> or
> 1 < 2 && 3 < 3 - False
In my opinion, that should evaluate to
1 < 1 // false
because we have a post-increment operator, and it
On Nov 12, 2016 8:21 AM, "David Walker" wrote:
>
> On Sat, Nov 12, 2016 at 3:08 AM Lauri Kenttä
wrote:
>
> > On 2016-11-11 19:03, David Walker wrote:
> > >
> > > I took a quick stab at implementing, and had something working for
> > > constant
On Sat, Nov 12, 2016 at 3:08 AM Lauri Kenttä wrote:
> On 2016-11-11 19:03, David Walker wrote:
> >
> > I took a quick stab at implementing, and had something working for
> > constant expressions, but handling something akin to:
> >
> > $a = 2;
> > if (1 < $a++ < 3) {
> >
On 2016-11-11 19:03, David Walker wrote:
I took a quick stab at implementing, and had something working for
constant expressions, but handling something akin to:
$a = 2;
if (1 < $a++ < 3) {
...
}
Is a bit awkward in our expansions of : if (1 < $a++ && $a++ < 3).
Seems as if when processing
On 11/11/2016 6:03 PM, David Walker wrote:
> I took a quick stab at implementing, and had something working for constant
> expressions, but handling something akin to:
>
> $a = 2;
> if (1 < $a++ < 3) {
> ...
> }
>
> Is a bit awkward in our expansions of : if (1 < $a++ && $a++ < 3). Seems
> as
On Wed, Nov 9, 2016 at 12:48 PM Fleshgrinder wrote:
> On 11/8/2016 10:57 PM, David Walker wrote:
> > I don't think that alone allows the chaining of comparisons. I'd have to
> > look closer, but it'd seem to me that zend_ast_create_binary_op
> > (ZEND_AST_BINARY_OP)
Hi,
Fleshgrinder wrote:
That change would actually be brutally easy since we only need to change
the `%nonassoc` to `%left` and we are done.
Not quite. We'd still need to parse and compile these expressions
correctly. If we just add associativity, then we end up with Java's
behaviour.
--
On 11/8/2016 10:57 PM, David Walker wrote:
> I don't think that alone allows the chaining of comparisons. I'd have to
> look closer, but it'd seem to me that zend_ast_create_binary_op
> (ZEND_AST_BINARY_OP) evaluation might need to be amended as well. Seems it
> eventually calls a
On Tue, Nov 8, 2016 at 12:34 PM Fleshgrinder wrote:
> This requires associativity, as Python has it.
>
> https://docs.python.org/3/reference/expressions.html#comparisons
>
> The problem, as explained in the Python reference, is that in `x < y <
> z` the variables `x` and
On 11/7/2016 10:51 PM, David Walker wrote:
> Sense be damed ;-) . I'd attribute it to an identity of sorts (if it was
> to go all out with comparison chaining). Yes it makes little sense, in
> practice, but the truth of it would be the same.
>
> I realize that my comment, and question were going
On 2016-11-07 23:51, David Walker wrote:
On Mon, Nov 7, 2016 at 1:38 PM Fleshgrinder
wrote:
We are only extending binary to ternary for <= and <.
I realize that my comment, and question were going a bit off-topic with
going on about the chaining of comparisons, but I'm
On Mon, Nov 7, 2016 at 1:38 PM Fleshgrinder wrote:
> Hey guys! :)
The first one should definitely be an error since it makes no sense.
Sense be damed ;-) . I'd attribute it to an identity of sorts (if it was to
go all out with comparison chaining). Yes it makes little
On Sun, Nov 6, 2016 at 1:59 PM David Rodrigues
wrote:
> I guess that the biggest problem is about the code parsing. Currently PHP
> should supports what you wrote, but with another meaning. And personally I
> think that this feature is not too common on programming
I guess that the biggest problem is about the code parsing. Currently PHP
should supports what you wrote, but with another meaning. And personally I
think that this feature is not too common on programming language in
general, once that it is possible from first format (maybe more clear too).
Em
Validating whether a number is within a closed or open interval is
currently possible only via a construct like the following:
```
if (0 < $x && $x < 42) {
echo 'x is in (0, 42)';
}
if (0 <= $x && $x <= 42) {
echo 'x is in [0, 42]';
}
```
It is not very readable and repetitive. It would
16 matches
Mail list logo