Juerd writes: > Larry Wall skribis 2004-03-25 12:33 (-0800): > > On Thu, Mar 25, 2004 at 11:35:46AM -0800, Brent 'Dax' Royal-Gordon wrote: > > : Larry Wall wrote: > > : > say @bar.elems; # prints 1 > > : C<say>? Not C<print>? > > It's just a "println" spelled Huffmanly. > > Can't we instead just have a pseudo-filehandle or perhaps a tied one and > just use C<print> to print? > > ln.print @bar.elems; > print ln : @bar.elems; > > Though I'm not sure why a feature like this would be needed at all, so I > think this is something users should define something like this > themselves if they want it: > > my &say = &print.assuming :ors "\n"; > > (Wildly guessing syntax here. I cincerely hope parens won't be needed.)
Well I'm sincerely certain that they are. my &say := &print.assuming(:ors("\n")); > I think I prefer things the way they happen to already be. > > print @bar.elems, "\n"; Ugh. You do!? I think that's the biggest PITA in Perl. I never thought of "say", but I've been known to write: sub p { print @_, "\n" } In some of my more verbose scripts. It's a sign that something's wrong when on every one-liner I write, and in even some longer scripts, I specify -l on the command line. C<say> is indeed shorter than C<print>, and I like that, because I use it more often. Will there also be: sub complain([EMAIL PROTECTED]) { print $ERR: @_, "\n"; } :-) > Also, I think C<say> is a bad choice. Many people use a function called > C<say> for chat bots and text-to-speech. Uh huh, but the ones I have experience with use it as a method, so it doesn't interfere. $bot.say("Welcome, $user") Plus, a lot of people use C<index> to create an index, C<length> to find the length of an array, C<delete> to delete files, C<study> to do their homework, and C<die> to commit suicide (or was that C<goto>?). That's why variables have sigils, and lexicals have scopes... You even said yourself: my &say := ... That works even if C<say> is built-in. > It will of course be possible to override the builtin, but for a good > reason most people choose to not do that. > > Has this C<say> already been decided? Doesn't matter, because most of these decisions are up for discussion. I think everything that was "decided" when Apocalypse 3 was written has changed at least three times (contrast with Synposis 3 :-). Luke