[Oc-pm] perl6 if

Bob Mathews bobmath11 at icloud.com
Fri Dec 29 10:43:42 PST 2017


We're going to be talking Control Flow in perl6 for January's meeting, right?

Most major languages these days have C-derived syntax. An if statement looks like this:

if (...) { ... } else { ... }

In most C-derived languages, the parens are required, but the squiggle brackets are optional. (This causes some ambiguity when the "..."s contain other if statements, but whatever.) In perl5, both the parens and squigglies are required. But in perl6, the parens are optional and the squigglies are required. Not sure why they decided to go the opposite direction from every other language, but again, whatever.

I tend to prefer the Bourne shell syntax:

if ... then ... else ... fi

But I suppose that's horribly old-fashioned. Anyway, just my two cents. Anyone have any thoughts?

 -bob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/oc-pm/attachments/20171229/e1a17fb8/attachment.html>


More information about the Oc-pm mailing list