1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax io.streams.string sequences
7 HELP: <circular-string>
10 { "circular" circular } }
11 { $description "Creates a new circular string object. A circular string is a string object that can be accessed out of bounds and the index will wrap around to the start of the string." } ;
16 { "circular" circular } }
17 { $description "Creates a new " { $link circular } " object that wraps an existing sequence. By default, the index is set to zero." } ;
19 HELP: <growing-circular>
21 { "capacity" integer }
22 { "growing-circular" growing-circular } }
23 { $description "Creates a new growing-circular object." } ;
25 HELP: change-circular-start
27 { "n" integer } { "circular" circular } }
28 { $description "Changes the start index of a circular object." } ;
31 { $description "A tuple class that stores a sequence and its start index." } ;
33 HELP: growing-circular
34 { $description "A circular sequence that is growable." } ;
38 { "elt" object } { "circular" circular } }
39 { $description "Pushes an element to a " { $link circular } " object." } ;
41 HELP: push-growing-circular
43 { "elt" object } { "circular" circular } }
44 { $description "Pushes an element onto a " { $link growing-circular } " object." } ;
46 ARTICLE: "circular" "Circular sequences"
47 "The " { $vocab-link "circular" } " vocabulary implements the " { $link "sequence-protocol" } " to allow an arbitrary start index and wrap-around indexing." $nl
48 "Creating a new circular object:"
49 { $subsection <circular> }
50 { $subsection <circular-string> }
51 { $subsection <growing-circular> }
52 "Changing the start index:"
53 { $subsection change-circular-start }
54 "Pushing new elements:"
55 { $subsection push-circular }
56 { $subsection push-growing-circular } ;