in reply to Noble DOT vs the Allmighty ARROW

When i first came to Perl from Java/VB, i didn't like the arrow operator-> Now i do->

I suppose i'll feel a little uncomfortable at first, using the dot operator in Perl6, but things change.

So, looks like i am going to have to go ahead and say bring the dot operator on. Without change, things can get stale.

As for the underscore for the concatenation operator ... eduardo said it to me best - "How many times do you really use it?" Not that much->. :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)
  • Comment on (jeffa) Re: Noble DOT vs the Allmighty ARROW

Replies are listed 'Best First'.
Re: (jeffa) Re: Noble DOT vs the Allmighty ARROW
by pdcawley (Hermit) on May 08, 2002 at 08:54 UTC
    Having spent some time writing a largish program in perl 6 (and then porting it to perl 5 to make sure that the design was sound), I found that one of the persistent mistakes I kept making in my perl 5 code was trying to use . all the time instead of ->.

    However, the hardest thing to give up was the given/when syntax, which is just lovely. Being able to use the -> $foo, $bar {...} syntax to make anonymous functions of known arity was rather cool too, if a little more obscure...

      Could you expand on "writing a largish program in perl 6"? How does one go about doing such a thing? I thought p6 was merely in the design stage. Is there a "working" p6 interpreter that we can play with?

      -Blake

      You can still use Conway's switch module in Perl 5. It uses source filters to translate switch/case or given/when structures to Perl 5 structures.
        I know. The problem is that, AFAICT, source filters don't seem to work if you require a module at runtime. Which is jolly annoying 'cos I need to do that in a large chunk of the code I write.
Re: (jeffa) Re: Noble DOT vs the Allmighty ARROW
by dsheroh (Monsignor) on May 08, 2002 at 14:09 UTC
    Without change, things can get stale.

    True, but that does not mean that you should change things just for the sake of changing them. That breeds confusion, not progress. (see also: most Microsoft Office document formats)

    Now, I haven't been following perl 6 news at all, so I don't know why this is being changed. Anyone got a pointer handy so information about the reasons behind the ->/. thing?

      I tested my all of my perl code that was handy with this script:
      #!/usr/bin/perl -ln $arrow += () = /->/g; $period += () = /\./g; END { print "arrows occured $arrow times"; print "periods occured $period times"; }
      and got these results:
      arrows occured 454 times
      periods occured 227 times
      
      Now Perl has always been Huffman encoded (things used often should require less work than things done seldomly) so '.' (or some other one character operator) should replace '->'. When they went looking for a replacement they noticed that almost everyone else in the known world was using '.'. There are also other features in Perl 6 that cut down on the number of concats needed.
      Hmmm, i believe this was the first public mention of the change. The only mention of why is to be '...in line with industry-wide practice...'

      http://www.perl.com/pub/a/2001/10/02/apocalypse3.html?page=6

      And as for Microsoft ... that is not change ... that is marketing! @#$@#$!! !#@$#@$!

      jeffa

      Striving for a MicroSoft-free world