<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>man/icanhasnext.Rd</filename>
    </added>
    <added>
      <filename>man/liply.Rd</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -14,6 +14,7 @@ Description: plyr is a set of tools that solves a common set of
 URL: http://had.co.nz/plyr
 Depends: R (&gt;= 2.8)
 Suggests: RUnit, abind, tcltk
+Enhances: iterator
 License: GPL
 LazyData: true
 Collate: 'dimensions.r' 'helper-arrange.r' 'helper-col-wise.r'</diff>
      <filename>DESCRIPTION</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
 #' An indexed array
-#' Create a indexed array, a space efficient way of indexing into a large array
+#' Create a indexed array, a space efficient way of indexing into a large
+#' array.
 #' 
 #' @param env environment containing data frame
 #' @param index list of indices
 #' @keywords internal
-#' @aliases indexex_array [[.indexed_array names.indexed_array
+#' @aliases indexed_array [[.indexed_array names.indexed_array
 #'   length.indexed_array
 indexed_array &lt;- function(env, index) {
   exact &lt;- all(laply(index, is.numeric))</diff>
      <filename>R/indexed-array.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,19 @@
+#' Add has next functionality to any iterator
+#' 
+#' The iterator package relies of catching \code{StopIteration} errors
+#' to detect when iteration is complete.  This function wraps any interator
+#' with an iterator that additionally provides a boolean \code{hasNext} method
+#' which reports whether or not the iterator has another element.  This
+#' simplifies programming as you can use a simple while loop, instead of 
+#' needing a \code{tryCatch} to detect completion.
+#'
+#' @keywords internal
+#' @aliases end_iteration iteration_has_ended new_iterator is.iterator 
+#'   icanhasnext
+#' @param iterator iterator to add \code{hasNext} capability to
+#' @examples
+#' it &lt;- icanhasnext(icount(3))
+#' while(it$hasNext()) print(it$nextElem())
 icanhasnext &lt;- function(iterator) {
   # If already has hasNext function return iterator unchanged
   if (!is.null(iterator$hasNext)) return(iterator)
@@ -33,6 +49,7 @@ icanhasnext &lt;- function(iterator) {
   
   new_iterator(nextElem, hasNext = hasNext)
 }
+
 end_iteration &lt;- function() stop('StopIteration', call.=FALSE)
 iteration_has_ended &lt;- function(e) {
   identical(conditionMessage(e), 'StopIteration')</diff>
      <filename>R/iterator.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,15 @@
+#' Experimental iterator based version of llply.
+#' 
+#' Because iterators do not have known length, \code{liply} starts by 
+#' allocating an output list of length 50, and then doubles that length 
+#' whenever it runs out of space.  This gives O(n ln n) performance rather 
+#' than the O(n ^ 2) performance from the naive strategy of growing the list
+#' each time.
+#' 
+#' @keywords manip
+#' @param .iterator iterator object
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
 liply &lt;- function(.iterator, .fun = NULL, ...) {
   stopifnot(is.iterator(.iterator))
   if (is.null(.fun)) return(as.list(.iterator))</diff>
      <filename>R/ply-iterator.r</filename>
    </modified>
    <modified>
      <diff>@@ -2,9 +2,10 @@
 \title{An indexed array...}
 \usage{indexed_array(env, index)}
 \description{An indexed array
-Create a indexed array, a space efficient way of indexing into a large array}
+Create a indexed array, a space efficient way of indexing into a large
+array.}
 \keyword{internal}
-\alias{indexex_array}
+\alias{indexed_array}
 \alias{[[.indexed_array}
 \alias{names.indexed_array}
 \alias{length.indexed_array}</diff>
      <filename>man/indexed_array.Rd</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>520fc56f56b5db25dbe0548f65e8510c185a5972</id>
    </parent>
  </parents>
  <author>
    <name>hadley</name>
    <email>h.wickham@gmail.com</email>
  </author>
  <url>http://github.com/hadley/plyr/commit/f4d6c9fff31c08528df2b9456db88a992c2870c6</url>
  <id>f4d6c9fff31c08528df2b9456db88a992c2870c6</id>
  <committed-date>2009-09-15T06:59:46-07:00</committed-date>
  <authored-date>2009-09-15T06:59:46-07:00</authored-date>
  <message>Complete documentation</message>
  <tree>e96fba9418b6a51bd3ccf3ffc2f08ec957d50a18</tree>
  <committer>
    <name>hadley</name>
    <email>h.wickham@gmail.com</email>
  </committer>
</commit>
