No, that doesn't really make sense in Julia. Java and C don't have such a
feature either. What's happening there is that the `else` clause takes a
single expression, which can be a for loop.

On Mon, May 23, 2016 at 2:06 PM, Ford Ox <[email protected]> wrote:

> Yep that is exactly what I mean under keyword chaining:
>
> If multiple control flow keywords are on the same line, they need only one
> end keyword to end their block.
>
> For example in java / c you can do
> if(...)
> else for(...){
> ...
> }
>
>
>
> Dne pondělí 23. května 2016 20:00:07 UTC+2 Isaiah napsal(a):
>>
>> Also, the given example is already valid syntax... (simply missing a
>> final `end`)
>>
>> On Mon, May 23, 2016 at 1:51 PM, Stefan Karpinski <[email protected]>
>> wrote:
>>
>>> What is "keyword chaining"? Can you provide examples of languages that
>>> do something like this?
>>>
>>> On Mon, May 23, 2016 at 1:43 PM, Ford Ox <[email protected]> wrote:
>>>
>>>> Why is there no keyword chaining in julia?
>>>>
>>>> for x in 1:30, y in 1:30
>>>>     if x == 5 && y == 5
>>>>         dosomething()
>>>>     else let obj = array[y, x]  # Chained keywords here
>>>>         if obj == FOO
>>>>             dosomethingelse()
>>>>         end
>>>>     end
>>>> end
>>>>
>>>>
>>>>
>>>
>>

Reply via email to