On Tue, Jan 06, 2009 at 08:39:00PM -0600, Patrick R. Michaud wrote:
: On Tue, Jan 06, 2009 at 01:50:06PM -0800, Dave Whipp wrote:
: > 
: > S16 requires that "say" (and "print") when called with no args should
: > be a compile-time error. Rakudo accepts it with no error.
: 
: Since S16 has been in an incomplete "draft" status for such a long
: time, I'd like to get confirmation from p6l about this part of
: the spec before committing it to an implementation.

Hmm, well, the case for complaining on "print" is pretty clear cut,
since print with no args is a no-op, and hence can only mean they
were intending to default to $_.

With "say" it's not such a clear case, since they might have been
intending to mean "print nothing but emit the newline".  On the
other hand, they might have meant to say $_, in which case they'd
thank us for the error.  And it's pretty easy to use any of

    say '';
    say ();
    ''.say;
    print "\n";

to be clearer about the intent.  So my inclination is to outlaw
bare "say" as well, as an aid to catching a common p5thinko that
some folks might otherwise find difficult to debug.

I suppose a case could be made for just making one or both of those
warnings.  STD already has a mechanism for reporting "Possible
difficulties", so maybe that's a good-enough way to handle it.

Larry

Reply via email to