-
Notifications
You must be signed in to change notification settings - Fork 12
Should without allow chaining? #63
Copy link
Copy link
Open
Labels
Next Resolutions MeetingThis issue will be reviewed in a future Resolutions Meeting, possibly the nextThis issue will be reviewed in a future Resolutions Meeting, possibly the nextlanguageChanges to the Raku Programming LanguageChanges to the Raku Programming Language
Metadata
Metadata
Assignees
Labels
Next Resolutions MeetingThis issue will be reviewed in a future Resolutions Meeting, possibly the nextThis issue will be reviewed in a future Resolutions Meeting, possibly the nextlanguageChanges to the Raku Programming LanguageChanges to the Raku Programming Language

Currently, the rationale for why
unlessdoes not allow chaining is basically, "unlessis exactly equivalent toif not, andunless...elseunless...elseis confusing, so just reverse your logic if you need more than one alternative."The same logic seems to apply to
without, which, unlikewithbut likeunless, can't have chained conditionals or anelse. But does the same logic actually apply?I've recently been writing top-level executables where I really have wished there was
without...orwithout...else, because a lot of logic there is checking if conditions for execution exist (often including checking for the presence of user flags) wherewithoutis much clearer thanif not defined(not to mention the subtle differences in Perl 6's vs. Perl 5'sdefinedare a bit of a trap here).I don't want to contribute to language bloat, but I think that cognitive load is decreased with the introduction of an
orwithoutand allowing chaining towithout, and the prohibition against chaining afterunlesswas always normative anyway—something I think we usually do in Perl with great hesitancy, and certainly not to promote hobgoblin-minded consistency.Addendum: I didn't mention
orelse, but that's becausewithout EXPR1 orelse EXPR2 orelse EXPR3—while admittedly useful—isn't a substitute any more thanif EXPR1 or EXPR2 or EXPR3is a substitute forelsif.