Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: further explain fill/fill! #9015

Merged
merged 1 commit into from
Nov 16, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4132,11 +4132,17 @@ Constructors

.. function:: fill(x, dims)

Create an array filled with the value ``x``
Create an array filled with copies of the value ``x``.
For e.g., ``fill(1.0, (10,10))`` returns a 10x10 array of floats, with each
element initialized to 1.0

If ``x`` is an object reference, all elements will refer to the same object.
For e.g., ``fill(Foo(), dims)``, will return an array filled with the result of evaluating Foo() once.

.. function:: fill!(A, x)

Fill the array ``A`` with the value ``x``
Fill the array ``A`` with copies of the value ``x``. If ``x`` is an object reference, all elements will refer to the same object.
For e.g., ``fill!(A, Foo())``, will return ``A`` filled with the result of evaluating Foo() once.

.. function:: reshape(A, dims)

Expand Down