[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?
>
>

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

2016-05-07 Thread passerby51
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: Possible mistake in the manual?

2016-05-04 Thread passerby51
I think I have done the pull request on GitHub (ID: aaamini). I hope I have 
done it correctly.

On Wednesday, May 4, 2016 at 12:34:59 PM UTC-7, passerby51 wrote:
>
> OK... thanks. Not sure how to do a pull request, but will try to learn. 
> Otherwise, will try to edit on GitHub. (I have to revive my dusty old 
> Github account it seems!)
>
> On Wednesday, May 4, 2016 at 11:28:30 AM UTC-7, Matt Bauman wrote:
>>
>> Good catch!  Would you be willing to open a pull request to correct it? 
>>  You can edit it directly on GitHub if you'd prefer: 
>> https://github.com/JuliaLang/julia/edit/master/doc/manual/arrays.rst
>>
>> Thanks!
>>
>> On Wednesday, May 4, 2016 at 2:08:58 PM UTC-4, passerby51 wrote:
>>>
>>> Hello,
>>>
>>> In the discussion of arrays in the manual, in the assignment section 
>>> <http://docs.julialang.org/en/release-0.4/manual/arrays/#assignment> it 
>>> says of this:
>>>
>>> A[I_1, I_2, ..., I_n] = X
>>>
>>> The it does the following:
>>>
>>> If X is an array, its size must be (length(I_1), length(I_2), ..., 
>>>> length(I_n)), and the value in location i_1, i_2, ..., i_n of A is 
>>>> overwritten with the valueX[I_1[i_1], I_2[i_2], ..., I_n[i_n]]. If X is 
>>>> not an array, its value is written to all referenced locations of A.
>>>
>>>
>>> It seems to me that it should be this:
>>>
>>> If X is an array, its size must be (length(I_1), length(I_2), ..., 
>>> length(I_n)), and the value in location I_1[i_1], I_2[i_2], ..., 
>>> I_n[i_n]  of A is overwritten with the valueXi_1, i_2, ..., i_n]. If X is 
>>> not an array, its value is written to all referenced locations of A.
>>>
>>>
>>>

[julia-users] Re: Possible mistake in the manual?

2016-05-04 Thread passerby51
OK... thanks. Not sure how to do a pull request, but will try to learn. 
Otherwise, will try to edit on GitHub. (I have to revive my dusty old 
Github account it seems!)

On Wednesday, May 4, 2016 at 11:28:30 AM UTC-7, Matt Bauman wrote:
>
> Good catch!  Would you be willing to open a pull request to correct it? 
>  You can edit it directly on GitHub if you'd prefer: 
> https://github.com/JuliaLang/julia/edit/master/doc/manual/arrays.rst
>
> Thanks!
>
> On Wednesday, May 4, 2016 at 2:08:58 PM UTC-4, passerby51 wrote:
>>
>> Hello,
>>
>> In the discussion of arrays in the manual, in the assignment section 
>> <http://docs.julialang.org/en/release-0.4/manual/arrays/#assignment> it 
>> says of this:
>>
>> A[I_1, I_2, ..., I_n] = X
>>
>> The it does the following:
>>
>> If X is an array, its size must be (length(I_1), length(I_2), ..., 
>>> length(I_n)), and the value in location i_1, i_2, ..., i_n of A is 
>>> overwritten with the valueX[I_1[i_1], I_2[i_2], ..., I_n[i_n]]. If X is 
>>> not an array, its value is written to all referenced locations of A.
>>
>>
>> It seems to me that it should be this:
>>
>> If X is an array, its size must be (length(I_1), length(I_2), ..., 
>> length(I_n)), and the value in location I_1[i_1], I_2[i_2], ..., 
>> I_n[i_n]  of A is overwritten with the valueXi_1, i_2, ..., i_n]. If X is 
>> not an array, its value is written to all referenced locations of A.
>>
>>
>>

[julia-users] Possible mistake in the manual?

2016-05-04 Thread passerby51
Hello,

In the discussion of arrays in the manual, in the assignment section 
 it 
says of this:

A[I_1, I_2, ..., I_n] = X

The it does the following:

If X is an array, its size must be (length(I_1), length(I_2), ..., 
> length(I_n)), and the value in location i_1, i_2, ..., i_n of A is 
> overwritten with the valueX[I_1[i_1], I_2[i_2], ..., I_n[i_n]]. If X is 
> not an array, its value is written to all referenced locations of A.


It seems to me that it should be this:

If X is an array, its size must be (length(I_1), length(I_2), ..., 
length(I_n)), and the value in location I_1[i_1], I_2[i_2], ..., I_n[i_n] 
 of A is overwritten with the valueXi_1, i_2, ..., i_n]. If X is not an 
array, its value is written to all referenced locations of A.