# New Ticket Created by Vasily Chekalkin # Please include the string: [perl #60390] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60390 >
Hello. There is MMD based implementation of 'succ'/'pred' handling. -- Bacek
commit a47517ca10be429faabf3383b453c9c93262ab04 Author: Vasily Chekalkin <[EMAIL PROTECTED]> Date: Fri Nov 7 15:55:49 2008 +1100 Revert "[rakudo] prefix/postfix ++ and -- now delegate to succ and pred, respectively" This reverts commit 48058ab367d5086e98d63edea4ce1a25c784ba25. Conflicts: diff --git a/languages/perl6/src/builtins/op.pir b/languages/perl6/src/builtins/op.pir index e256b6a..92c4eb7 100644 --- a/languages/perl6/src/builtins/op.pir +++ b/languages/perl6/src/builtins/op.pir @@ -31,47 +31,28 @@ src/builtins/op.pir - Perl6 builtin operators .sub 'postfix:++' :multi(_) .param pmc a $P0 = clone a - 'prefix:++'(a) + inc a .return ($P0) .end .sub 'postfix:--' :multi(_) .param pmc a $P0 = clone a - 'prefix:--'(a) + dec a .return ($P0) .end .sub 'prefix:++' :multi(_) .param pmc a - push_eh do_inc - $P1 = find_method a, "succ" - pop_eh - a.$P1() - goto done - - do_inc: - pop_eh inc a - - done: .return (a) .end .sub 'prefix:--' :multi(_) .param pmc a - push_eh do_dec - $P1 = find_method a, "pred" - pop_eh - a.$P1() - goto done - - do_dec: - pop_eh dec a - done: .return (a) .end diff --git a/languages/perl6/src/classes/Object.pir b/languages/perl6/src/classes/Object.pir index fea74bc..6a57c0c 100644 --- a/languages/perl6/src/classes/Object.pir +++ b/languages/perl6/src/classes/Object.pir @@ -167,6 +167,29 @@ Return a string representation of the object .end +=item increment + +Override increment in Objects to use 'succ' method. + +=cut + +.sub '' :method :vtable('increment') + self = self.'succ'() + .return(self) +.end + +=item decrement + +Override decrement in Objects to use 'pred' method. + +=cut + +.sub '' :method :vtable('decrement') + self = self.'pred'() + .return(self) +.end + + =item new() Create a new object having the same class as the invocant.