On Wed, Apr 25, 2001 at 07:23:47PM -0700, Edward Peschko wrote:
> On Thu, Apr 26, 2001 at 03:16:46AM +0100, Simon Cozens wrote:
> > SPACE SENSITIVE and SOME OF US HAVE TO TEACH IT. Do you understand yet?

Just for the record, I'm totally with Simon here.  Having . do triple
duty (decimals, method calls and string concat) will be hard enough to
teach.  Throw obscure whitespace rules in there and you'll spend all
day trying to explain it.


> The problem already comes up... '4. 5' is not the same as '4.5'. '.' 
> is *already* doing double duty as decimal mark. The fact that you
> don't see this very often shows exactly how rare the mistake arises.

Most people, by around first grade, understand that "4.5" is a number.
"4. 5" is (thank goodness) a syntax error, so any confusion is
resolved immediately.  '4 .5' for some reason is not, but as Casey
pointed out that's probably a parsing hiccup.

Additionally, its pretty damn rare for anyone to want to concatenate
two bare numbers.


> I think the 'tutorial' will come from experience. When the error
> that you get from $a.$b comes up (and it should be a syntax error)
> you'll see exactly what is wrong. If $a. $b, again, syntax
> error. Only $a . $b should be allowed.
>
> The only point of contention would be if someone said $a . b, when they meant
> $a.b. And how often will that occur?

Very often, because I'd expect $a.$b to work and be very surprised
when it fails!  Very little else in Perl is white-space sensitive
without very good, fairly obvious reasons (as with decimal numbers
above), let's avoid it here.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One
They just don't make any good porn music anymore, do they?
        - WXDX DJ refering to "More, More, More"

Reply via email to