develooper Front page | perl.perl6.language | Postings from March 2009

r25819 - docs/Perl6/Spec

March 13, 2009 07:22
r25819 - docs/Perl6/Spec
Message ID:
Author: ruoso
Date: 2009-03-13 15:21:56 +0100 (Fri, 13 Mar 2009)
New Revision: 25819

[spec] Add Iterator::Unshift to S07

Modified: docs/Perl6/Spec/S07-iterators.pod
--- docs/Perl6/Spec/S07-iterators.pod	2009-03-13 14:06:26 UTC (rev 25818)
+++ docs/Perl6/Spec/S07-iterators.pod	2009-03-13 14:21:56 UTC (rev 25819)
@@ -163,6 +163,22 @@
 original order or if it wasn't consumed. In that case, it should fail
 with UnorderedPushBackException or BadPushBackException.
+=head1 The Iterator::Unshift Role
+This role defines an iterator that can receive new elements in the top
+of the stack, it works like pushback, but it should be able to store
+objects that are completely new to this stream. Either by being backed
+by a mutable list or by providing a local stack. This role implies
+Iterator::PushBack, where pushback will be handled by unshift.
+The purpose of defining two different Roles is to give the user the
+"expect to fail" or "expect to succeed" semantics.
+=head2 method unshift($value) {}
+This unshifts $value either to the backed list or to a local stack of
+the iterator.
 =head1 Auxiliary Implementations
 Perl's built-ins require that a number of auxiliary types. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About