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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
From:
Larry Wall
Date:
May 31, 2005 12:21
Subject:
Re: reduce metaoperator on an empty list
Message ID:
20050531192147.GA24474@wall.org
On Mon, May 23, 2005 at 08:54:19PM +0000, mark.a.biggar@comcast.net wrote:
: 
: There are actuall two usefull definition for %.  The first which Ada calls 'mod' always returns a value 0<=X<N and yes it has no working value that is an identity.  The other which Ada calls 'rem' defined as follows:
: 
: Signed integer division and remainder are defined by the relation: 
: 
: A = (A/B)*B + (A rem B)
: 
:    where (A rem B) has the sign of A and an absolute value less than the absolute value of B. Signed integer division satisfies the identity: 
: 
: (-A)/B = -(A/B) = A/(-B)
: 
: It does have a right side identity of +INF.

I think % should behave as Perl 5 has it, especially insofar as it
coerces to integer.  That doesn't mean we can't have "mod" and/or
"rem" variants that have other semantics.  Infix operators are pretty
much in their own namespace anyway, so they won't clobber sub names.

Larry

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