Jerrad Pierce wrote:
>
> Perl6 does not *have* to break anything, and certainly not everything.
> The prime directive should be not to break things unless necessary.
> Translation should not be a fall-back panacea. And it surely isn't perfect...
Actually, this is false. If Perl 6 worked just like Perl 5 it would be
Perl 5.7 or something. The new major version indicates major changes.
You can't change things for the better if you just plain can't change
them in the first place. But I *do* agree that things shouldn't be
broken just for the heck of it.
> Okay so what about doing this then:
>
> [$return = ] open(bareword, string)
> acts as it currently does
> $handleobj = open(string)
> which is one arg in scalar context acts as you propose.
>
> Internally bareword filehandles and $handleobj could even be of the same type.
I think supporting two syntaxes that do the same thing is dangerous and
misleading. In this case, breaking the bareword syntax indicates that
Perl 6 open() is NOT Perl 5 open(), which is actually a good thing.
Also, your examples don't cover this:
$web = open "http://www.yahoo.com", GET;
Remember, additional args for the proposed open handler can follow the
filename.
> Yes, as a matter of fact I spent the afternoon reading all 120+ of them.
Awesome.
> print_out(\HANDLE, @data);
>
> sub print_out {
> my $handleref = shift;
> #my $handle = _{$handleref};
Again, this is really unneeded complexity just for the sake of "saving"
bareword filehandles from an almost-certain demise. :-) Truly, prefixing
$ to your filehandles isn't really that radical, and once you get used
to it it looks very Perlish.
> # $F = [1,2,3]; @F = deref($F);
This can already be expressed simply as @$F.
> I will conceed one thing though, this is a bit more Perl-ish, in the
> since that you are returning something of use, instead of the C-ish
> "I'll modify the arguments you give me".
Cool. The new syntax I feel is a big win. Most everyone seems to like it
and feel the same way. It may take some getting used to at first, it is
definitely more Perlish (even Larry agrees). :-)
-Nate