3 msΒ·
> overuse of sigils "Overuse" is subjective. If you are you suggesting that some use is good, can you give an example of usage you think is good and usage you
by raiph 12y ago
> overuse of sigils
"Overuse" is subjective. If you are you suggesting that some use is good, can you give an example of usage you think is good and usage you think represents overuse?
That said, I didn't like some specific things about use of symbols in P5 and the problems have been fixed in Perl 6.
And of course there is more than one way to do it, for example this is one way to write the Ackermann function in P6 using Unicode names (symbols) for parameter/argument identifiers:
proto A(Int \π, Int \π) { @[π][π] //= {} }
multi A(0, Int \π) { π + 1 }
multi A(1, Int \π) { π + 2 }
multi A(2, Int \π) { 3 + 2 π }
multi A(3, Int \π) { 5 + 8 * (2 π - 1) }
multi A(Int \π, 0 ) { A(π - 1, 1) }
multi A(Int \π, Int \π) { A(π - 1, A(π, π - 1)) }
(Based on http://rosettacode.org/wiki/Ackermann_function#Perl_6 http://rosettacode.org/wiki/Ackermann_function#Perl_6)
- raiph 12y agoHopefully better formatting: proto A(Int \π, Int \π) { @[π][π] //= {} } multi A(0, Int \π) { π + 1 } multi A(1, Int \π) { π + 2 } multi A(2, Int \π) { 3 + 2 π } multi A(3, Int \π) { 5 + 8 * (2 π - 1) } multi A(Int \π, 0) { A(π - 1, 1) } multi A(Int \π, Int \π) { A(π - 1, A(π, π - 1)) }