[perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Moritz Lenz via RT
On Wed Nov 19 07:35:48 2008, masak wrote: > what should the behaviour of sign($x) be when $x is complex? I'd argue that it's a Failure. If you care about complex numbers, you usually want an angle instead, which you can get with Complex.polar. (And it's easier to give it a another meaning later t

Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread TSa
HaloO, Moritz Lenz via RT wrote: On Wed Nov 19 07:35:48 2008, masak wrote: what should the behaviour of sign($x) be when $x is complex? I'd argue that it's a Failure. This is a bit drastic. If one computes in the complex domain a complex valued sign function is appropriate. multi sub s

Should a closure-in-a-string get the placeholder parameters from its surroundings?

2008-11-20 Thread Carl Mäsak
I expected this to DWIM today: $ perl6 -e 'my $cl = { "$^name upcased becomes {$^name.uc}" }; say $cl("larry")' ...but it doesn't in Rakudo r32938: too few arguments passed (0) - 1 params expected ...and for understandable (if not good) reasons: the closure inside the string expects a parameter