Unless that's something added in later C standards, I'm pretty sure C 
doesn't have that (as Stefan stated, the case below is simply that an `if` 
or `else` can have a single statement (`{statements ... }`) being a block 
statement).
Julia does support what you are talking about, but only (AFAIK) for the 
`for` statement (which I do find useful, but I think it might be too 
confusing for `if`, `else`, etc.

On Monday, May 23, 2016 at 2:06:29 PM UTC-4, Ford Ox 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