Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- label `comprehensions`
- add cross-reference in section about scoping in for loops and
  comprehensions
  • Loading branch information
jiahao committed Aug 19, 2014
1 parent dcf18a9 commit 63023f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions doc/manual/arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ Expression Yields
Note that this form does not do any concatenation; each argument becomes
an element of the resulting array.

.. _comprehensions:

Comprehensions
--------------

Expand Down
8 changes: 4 additions & 4 deletions doc/manual/variables-and-scoping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ is a different variable than the outer local ``x``.
For Loops and Comprehensions
----------------------------

For loops and comprehensions have a special additional behavior: any
new variables introduced in their body scopes are freshly allocated for
each loop iteration. Therefore these constructs are similar to ``while``
loops with ``let`` blocks inside::
``for`` loops and :ref:`comprehensions <comprehensions>` have a special
additional behavior: any new variables introduced in their body scopes are
freshly allocated for each loop iteration. Therefore these constructs are
similar to ``while`` loops with ``let`` blocks inside::

Fs = cell(2)
for i = 1:2
Expand Down

0 comments on commit 63023f6

Please sign in to comment.