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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
Larry Wall
May 31, 2005 12:21
Re: reduce metaoperator on an empty list
Message ID:
On Mon, May 23, 2005 at 08:54:19PM +0000, 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.


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