Skip to content

Commit

Permalink
help text updates, to fix JuliaLang#4760
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Nov 9, 2013
1 parent b3a4d29 commit 287ace1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 47 deletions.
55 changes: 26 additions & 29 deletions doc/helpdb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,14 @@
"),

("Iterable Collections","Base","eltype","eltype(collection)
Determine the type of the elements generated by iterating
\"collection\". For associative collections, this will be a
\"(key,value)\" tuple type.
"),

("Iterable Collections","Base","indexin","indexin(a, b)
Returns a vector containing the highest index in \"b\" for each
Expand Down Expand Up @@ -724,8 +732,8 @@
Reduce the given collection with the given operator, i.e.
accumulate \"v = op(v,elt)\" for each element, where \"v\" starts
as \"v0\". Reductions for certain commonly-used operators are
available in a more convenient 1-argument form: \"max(itr)\",
\"min(itr)\", \"sum(itr)\", \"prod(itr)\", \"any(itr)\",
available in a more convenient 1-argument form: \"maximum(itr)\",
\"minimum(itr)\", \"sum(itr)\", \"prod(itr)\", \"any(itr)\",
\"all(itr)\".
The associativity of the reduction is implementation-dependent; if
Expand Down Expand Up @@ -928,6 +936,22 @@
"),

("Iterable Collections","Base","filter","filter(function, collection)
Return a copy of \"collection\", removing elements for which
\"function\" is false. For associative collections, the function is
passed two arguments (key and value).
"),

("Iterable Collections","Base","filter!","filter!(function, collection)
Update \"collection\", removing elements for which \"function\" is
false. For associative collections, the function is passed two
arguments (key and value).
"),

("Indexable Collections","Base","getindex","getindex(collection, key...)
Retrieve the value(s) stored at the given key or index within a
Expand Down Expand Up @@ -1014,27 +1038,6 @@
"),

("Associative Collections","Base","filter","filter(function, collection)
Return a copy of collection, removing (key, value) pairs for which
function is false.
"),

("Associative Collections","Base","filter!","filter!(function, collection)
Update collection, removing (key, value) pairs for which function
is false.
"),

("Associative Collections","Base","eltype","eltype(collection)
Returns the type tuple of the (key,value) pairs contained in
collection.
"),

("Associative Collections","Base","sizehint","sizehint(s, n)
Suggest that collection \"s\" reserve capacity for at least \"n\"
Expand Down Expand Up @@ -4869,12 +4872,6 @@ popdisplay(d::Display)
"),

("Arrays","Base","eltype","eltype(A)
Returns the type of the elements contained in A
"),

("Arrays","Base","iseltype","iseltype(A, T)
Tests whether A or its elements are of type T
Expand Down
35 changes: 17 additions & 18 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,12 @@ Iterable Collections

Determine whether an item is in the given collection, in the sense that it is
``isequal`` to one of the values generated by iterating over the collection.


.. function:: eltype(collection)

Determine the type of the elements generated by iterating ``collection``.
For associative collections, this will be a ``(key,value)`` tuple type.

.. function:: indexin(a, b)

Returns a vector containing the highest index in ``b``
Expand All @@ -463,7 +468,7 @@ Iterable Collections

.. function:: reduce(op, v0, itr)

Reduce the given collection with the given operator, i.e. accumulate ``v = op(v,elt)`` for each element, where ``v`` starts as ``v0``. Reductions for certain commonly-used operators are available in a more convenient 1-argument form: ``max(itr)``, ``min(itr)``, ``sum(itr)``, ``prod(itr)``, ``any(itr)``, ``all(itr)``.
Reduce the given collection with the given operator, i.e. accumulate ``v = op(v,elt)`` for each element, where ``v`` starts as ``v0``. Reductions for certain commonly-used operators are available in a more convenient 1-argument form: ``maximum(itr)``, ``minimum(itr)``, ``sum(itr)``, ``prod(itr)``, ``any(itr)``, ``all(itr)``.

The associativity of the reduction is implementation-dependent; if you
need a particular associativity, e.g. left-to-right, you should write
Expand Down Expand Up @@ -595,6 +600,16 @@ Iterable Collections
Determine whether every element of ``a`` is also in ``b``, using the
``in`` function.

.. function:: filter(function, collection)

Return a copy of ``collection``, removing elements for which ``function`` is false.
For associative collections, the function is passed two arguments (key and value).

.. function:: filter!(function, collection)

Update ``collection``, removing elements for which ``function`` is false.
For associative collections, the function is passed two arguments (key and value).


Indexable Collections
---------------------
Expand Down Expand Up @@ -669,18 +684,6 @@ As with arrays, ``Dicts`` may be created with comprehensions. For example,

Update collection with pairs from the other collections

.. function:: filter(function, collection)

Return a copy of collection, removing (key, value) pairs for which function is false.

.. function:: filter!(function, collection)

Update collection, removing (key, value) pairs for which function is false.

.. function:: eltype(collection)

Returns the type tuple of the (key,value) pairs contained in collection.

.. function:: sizehint(s, n)

Suggest that collection ``s`` reserve capacity for at least ``n`` elements. This can improve performance.
Expand Down Expand Up @@ -3271,10 +3274,6 @@ Basic functions

Returns a tuple containing the dimensions of A

.. function:: eltype(A)

Returns the type of the elements contained in A

.. function:: iseltype(A,T)

Tests whether A or its elements are of type T
Expand Down

0 comments on commit 287ace1

Please sign in to comment.