On 2/8/06, Larry Wall wrote:
 > From: Damian Conway <[EMAIL PROTECTED]>
 > I've now been using C<say> (via Perl6::Say) for some time -- testing our
 collective intuition on this -- and it turns out that b. isn't the least
 surprising. At least, not to me. In fact, I am regularly (and annoyingly)
> re-surprised every time $\ overrides what I was sure was going to be newline.

The question basically boils down to how you think about "say".

I guess I think of "say" as "print + \n" too... because that's how everyone explains it. If we told everyone it meant "print + ORS", I think it would be less surprising. Of course, I hardly ever set a record separator, and I'm not sure what Damian was doing that led him to want to set one and to use 'say' at the same time.

What's the difference between an ORS and a newline anyway? The purpose of a newline is typically to provide a visual separation... hm. Maybe we should take a step back: 'say' and ORS's are both a kind of shortcut to save you from typing everything out explicitly in every print statement.

What if 'print' never added anything to its output, and 'say' always added the field and record separators? The default ORS should then be \n. Instead of turning the separators on and off (as in P5), you would switch between using 'print' and 'say'.

(You might also make an argument that the default OFS should be a space or a tab, but I think OFS="" and ORS="\n" are probably what most people want most of the time. That certainly fits my typical uses of 'print' and 'say'.)



-David "say what?" Green

Reply via email to