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:
: > On Wed, Apr 25, 2001 at 03:33:52PM -0700, Edward Peschko wrote:
: > > > Please, no. Some of us have to *teach* this language.
: > > Then I guess that either space sensitive '.' is the answer
: >
: > Sorry. I'll try it again.
: >
: > SPACE SENSITIVE and SOME OF US HAVE TO TEACH IT. Do you understand yet?
: >
: > Are you *really* willing to deal with hundreds of newbies who don't
: > understand why $a . $b isn't the same as $a .$b and isn't the same as
: > $a. $b and isn't the same as $a.$b? And do you realise what the only
: > "good" answer we can possibly give them is? "Because Ed said so".
:
: Argh.
:
: 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.
Perl 5:
print 4. 5 # error
print 4.5 # 4.5
print 4 .5 # 45
If you were to ask me, I'd say there is a bug in the last one, it
should be an error, .5 is a valid number. ( PS, don't talk about my
opinion here, unless it is really relevant. )
: 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.
It can't be a syntax error:
$a = Foo.new;
$b = "method";
print $a.$b( @params );
: The only point of contention would be if someone said $a . b, when they meant
: $a.b. And how often will that occur?
More often that you might think. I see Perl folks who love white
space writing:
print
$cgi -> header,
$cgi -> start_html,
$cgi -> h2( 'my page' ),
$cgi -> hr,
$cgi -> a(
{ -href => 'http://geeknest.com' },
$cgi -> font(
{ -color => 'red' },
'My homepage!',
),
),
$cgi -> end_html;
In anycase, it happens frequently already.
--
Casey West