Am 21.09.2014 02:22 schrieb "Sara Golemon" <poll...@php.net>:
>
> > It would also mean having to make { default block } into an
> > expression... with a return value (to be allowed on either side of the
> > boolean or)
> >
> Excellent point, a block only works with T_OR if it has a value.  I'm
> pretty sure that at this point, it doesn't.  That does put a monkey
> wrench into it.  Perhaps a lambda could accommodate that?  Starts to
> get ugly though...

This strongly reminds me of statement expressions in GCC. Any block used in
an expression context, would evaluate to the last expression result
executed computed within the block.

Any code using such constructs, quickly becomes a totally unreadable mess.
GCC gets away with that because the whole thing, as far as I remember and
have seen in practise, is meant to be used within CPP macros, i.e. hidden
at the call sites. And PHP lacking a CPP macro concept, that excuse is not
present for us.

So,, to complete this great idea, we need to add a CPP macro like facility,
too :)

best regards
  Patrick

Reply via email to