develooper Front page | perl.perl6.language | Postings from May 2005

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
May 23, 2005 12:03
Re: reduce metaoperator on an empty list
Message ID:
HaloO Mark,

please don't regard the following as obtrusive.

you wrote:
> If as usual the definition of a right identity value e is that a op e = a for all a,
> then only +inf works.  Besdies you example should have been;

Or actually $n % any( abs($n)+1 .. Inf ) to really exclude 0
from the junction.

> $n % any (($n+1)..Inf),  $n % $n = 0. 

That depends on the definition of % and the sign of $n.
With the euclidean definition 0 <= ($n % $N == $n % -$N) < abs($N)
and for $n < 0 there's no identity at all. The identity element
has to be an element of the set, which +Inf isn't. It's a type.

BTW, is % defined as truncation in Perl6?
That would be a bit unfortunate. Simple but not well thought out.
TSa (Thomas SandlaƟ)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About