News for hackers. Stuff that matters.
Re:Show HN: A pure C89 implementation of Go channels, with b... by IlliOnato on Thursday December 14, 2023 @07:14AM (#38640535)
I would say that languages where "if" can be used as expression provide a different (perhaps better) syntax for the same ternary operator.

    a = if x then y else z
is just a more verbose version of

     a = x ? y : z;
Raku uses yet another form of the same operator:

     a = x ?? y :: z;
Syntactic sugar :-)
Re:Show HN: A pure C89 implementation of Go channels, with b... by lizmat on Thursday December 14, 2023 @07:53AM (#38640785)
It's actually

    a = x ?? y !! z
And that's because a single : is used for many other semantics in the Raku Programming Language. And ?? and !! standout better in code.

https://docs.raku.org/language/operators#infix_??_!!

Re:Show HN: A pure C89 implementation of Go channels, with b... by IlliOnato on Thursday December 14, 2023 @08:11AM (#38640933)
You are right, of course. Sorry! "Colon belongs to Larry" :-)

I think I made this mistake because :: was used in one of the drafts for Perl 6, but the final specification uses !!