On 4/24/07, Larry Wall <[EMAIL PROTECTED]> wrote:

On Tue, Apr 24, 2007 at 06:45:12PM -0400, Charles Bailey wrote:
: On 4/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
: >Note that unless no longer allows an else
: It's probably that I'm just having another day where skull > brain, but
I'm
: not sure I see the benefit to the language here.
:
: I think of "unless" as an alternate spelling for "if not", so it seems
: natural that it be possible to follow it with an "else".  I'll grant
that
: the (common) idiomatic usage of "unless" doesn't include an "else", but
that
: seems more an argument not to use an "else" rather than to forbid
it.  It's
: a bit like saying one can "continue" after a "while" but not an "until".
:
: Is there a parsing advantage that I've missed, or does it disambiguate
some
: other construct?

Yes, it's slightly easier to parse this way, and yes, it bugs me that
unless/else is not English, but mostly I changed it as a not-so-gentle
prod towards refactoring, based on the notion that if you have to
install a guard on a storage location being false, you've probably
got the scope of the storage location wrong.  And even if not, there
are several other ways to write it, at least one of which will be
generally more readable to other people.

I freely admit that it's less orthogonal and that I'm being high-handed.
:)


For situations such as this we have Rule One.

But I think I'd still ask you to reconsider, in a low-priority thread
somewhere.

My sense is that the driving consideration is more a use case than an
intrinsic element of language structure (to the extent that the two are
separable), and would have a more natural home in a pragma like
Design::BestPractice (or Lingua::Franca or Wheels::Training or
Lingua::Fascist, depending on one's point of view).  Maybe I'm just thinking
too neutrally of unless === if not, rather than unless === if shouldn't be.

Either way, it's a pretty minor point -- certainly nothing as mind-bending
as a good JAPH or with the scary security implications of
parens-specify-an-executable-block, so 'nuff said.

--
Regards,
Charles Bailey
Lists: bailey _dot_ charles _at_ gmail _dot_ com
Other: bailey _at_ newman _dot_ upenn _dot_ edu

Reply via email to