| [reply] |
Unfortunately, Perl 5's import and subroutine prototype mechanisms aren't quite up to the task ...
I wasn't critiquing your implementation of Perl6::Say, just the useability.
As you say, it's just one of those features that you cannot adaquately emulate at the Perl level. I'm having a go at trying my PP_say() wrapper around pp_print() in pp_hot.c--but it segfaults with my first attempt (and second:().
Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
| [reply] |
I agree. And it's probably not going to be a hard patch. But there will be the backwards compatability police - as adding 'say' as a keyword might possibly break existing code.
* grepping old sources *
Funny. Seems it might "break" one module I made a long, long time ago:
sub say
{
print(STDOUT @_);
if ($_[$#_] !~ /\n$/)
{
print(STDOUT "\n");
}
}
As far as I can tell, it was written in 1997 or 1998. I can live with that breaking (it seems to be doing something similar to Perl6::Say anyway - although I can't tell anymore whether adding the newline, or the printing to STDOUT was the main feature for it). But, if proposed, someone is bound to make the unsupported claim that "thousands and thousands of programs will be broken".
Hmmm, looking at the code I digged up I can see the charm of a print function that adds a newline only if the string to print doesn't end with a newline. Kind of like chomp only chopping of newlines. | [reply] [d/l] |