Re: Pike 8.0 RC1
"Per Hedbor () @ Pike (-) importm?te f?r mailinglistan" <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
> It makes a lot more sense in C, but yes in Pike that would be > equivalent to ||. In C || gives 0 or 1. I'm for being > gcc-extension-compatible when it makes sense though. It is called the 'Elvis operator' for unclear reasons. Anyway, searching for it gives some more details. It is frequently used in PHP, which might be why it came up at Opera. C#, perl6 and swift has ??, which works much like || (or ?:) in pike, but only checks for null (not general false). In lua and javascript you can, much like in pike, use the or operator. (Perl6 has replaced A?B:C with A??B!!C for reasons that are not clear to me.) (I also found out that PHP, of course, is slightly different from all other languages when it comes to ?:, it binds ?: as the /highest/ instead of the /lowest/ priority operator "due to an unfortunate error in the grammar file"). -- Per Hedbor