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

x, xx, and negative counts

Thread Next
From:
Mark J. Reed
Date:
May 29, 2007 11:23
Subject:
x, xx, and negative counts
Message ID:
f60fe000705291121l5ffa1acfq3b09e03f9af1670c@mail.gmail.com
 My expectation before reading the delta was that negative counts
would do a reversal:

"123" x -1 = "321"

('a', 'b', 'c') xx -3 = ('c', 'b', 'a', 'c', 'b', 'a', 'c', 'b', 'a');

I don't know why I think that makes sense, but it was honestly my
first thought.  Does it make sense to anyone else?  Is there a
compelling reason I'm missing for having negative values behave as if
they were zero rather than adding some other potentially useful
functionality?

-- 
Mark J. Reed <markjreed@mail.com>

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