Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Perl6 Operator List, Take 5
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Larry Wall  
View profile  
 More options Oct 30 2002, 1:48 am
Newsgroups: perl.perl6.language
From: la...@wall.org (Larry Wall)
Date: Tue, 29 Oct 2002 22:29:26 -0800 (PST)
Local: Wed, Oct 30 2002 1:29 am
Subject: RE: [RFC] Perl6 Operator List, Take 5
On Tue, 29 Oct 2002, David Whipp wrote:

: Larry Wall [mailto:la...@wall.org] wrote:
: > : unary (postfix) operators:
: > :    ...   - [maybe] same as ..Inf     [Damian votes Yes]
: >
: > I wonder if we can possibly get the Rubyesque leaving out of
: > endpoints by saying something like 1..!10.
:
: Perhaps we could use the less-than symbol: 1 ..< 10
:
: Similarly: 1 >..< 10  ==  2..9

That front one is backwards--it would have to be 1 <..< 10.

But the biggest problem is that 1..<$iterator> is valid syntax.

Of course, ..! and ..^ have the same problem.  But it just seems like
it's really unlikely that someone would use a unary ! or ^ on the
endpoint term.  So with 1..!$x or 1..^$x it's likely to be right if
we guess (per the longest token rule) that the operator is ..! or ..^.
The same can't be said of ..<, alas.  But at least it might produce
a syntax error when it tries to parse the >.  Or no, it wouldn't
necessarily.  This parses:

    1..<$iterator> + 1;

but wrongly as

    1 ..< $iterator > +1;

Ick.

Of course, Real Mathematicians will want [1..10) and (1..10] instead.

Double ick.

I kind like ..^ the best because ^ is currently read "exclusive of"
anyway, sort of...

And the arrow can be read "up to", at least on that end of it.  I think
that ..^ is going to be much, much more common than ^.. will be.

There's also an issue of what (1..10) - 1 would or should mean, if anything.
Does it mean (1..9)?  Does 1 + (1..10) mean (2..10)?

And what would ('a' .. 'z') - 1 mean?

I think I'd better go to bed now...

Larry


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.