Re: [julia-users] Re: Accessing "for" loop variable outside the loop

2016-05-07 Thread Yichao Yu
On Sat, May 7, 2016 at 2:40 PM, passerby51  wrote:
> OK, I found the asnwer here:
> https://en.wikibooks.org/wiki/Introducing_Julia/Controlling_the_flow#Loop_variables_and_scope
> But it seems that I couldn't find it in the manual. Maybe I didn't search
> well, but if it doesn't appear there it is worth mentioning it.

http://julia.readthedocs.io/en/latest/manual/variables-and-scoping/#soft-local-scope

Suggestions/PR to improve the doc are welcome.

>
> On Saturday, May 7, 2016 at 11:37:36 AM UTC-7, passerby51 wrote:
>>
>> I was trying to use the for loop variable outside it, after breaking out
>> of the loop, to see how many iterations were executed. But it seems to be
>> that the loop variable is not accessible outside the loop? Is that the case?
>> Does this apply to all the variables defined inside the loop?
>>
>


[julia-users] Re: Accessing "for" loop variable outside the loop

2016-05-07 Thread passerby51
OK, I found the asnwer here:
https://en.wikibooks.org/wiki/Introducing_Julia/Controlling_the_flow#Loop_variables_and_scope
But it seems that I couldn't find it in the manual. Maybe I didn't search 
well, but if it doesn't appear there it is worth mentioning it.

On Saturday, May 7, 2016 at 11:37:36 AM UTC-7, passerby51 wrote:
>
> I was trying to use the for loop variable outside it, after breaking out 
> of the loop, to see how many iterations were executed. But it seems to be 
> that the loop variable is not accessible outside the loop? Is that the 
> case? Does this apply to all the variables defined inside the loop?
>
>