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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
From:
=?ISO-8859-1?Q?=22TSa_=28Thomas_Sandla=DF=29=22?=
Date:
May 23, 2005 12:03
Subject:
Re: reduce metaoperator on an empty list
Message ID:
429228F0.7090808@orthogon.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About