It looks to me like everything in the `for` loop behaves like
variables inside a `let` block. Yes, one could argue that a `for` loop
variable should always be a new variable, making it equivalent to
let i
for i = itr
...
end
end
but that does make the constructs less orthogonal. In any case I don't
see how this is "do or don't, it depends". Depends on what?
On Tue, Apr 12, 2016 at 12:48 PM, Stefan Karpinski <[email protected]> wrote:
> On Tue, Apr 12, 2016 at 12:33 PM, Jeff Bezanson <[email protected]>
> wrote:
>>
>> > And then, some like "for" do or don't, it depends.
>>
>> Is that really true? I don't believe there is a case where `for`
>> behaves differently than `let`.
>
>
> julia> i = 1
> 1
>
> julia> for i = 2:10
> println(i)
> end
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
>
> julia> i
> 10