[fpc-devel] Fwd: While - Otherwise Statement

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Tue Oct 13 15:40:14 CEST 2015


wkitty42 at windstream.net wrote:
> On 10/13/2015 04:32 AM, Michael Van Canneyt wrote:
>>
>>
>> On Mon, 12 Oct 2015, wkitty42 at windstream.net wrote:
>>
>>> On 10/12/2015 03:43 PM, Martin Frb wrote:
>>>> Actually the above does not represent what the actual feature 
>>>> request is about
>>>>
>>>> The "else" is to be executed, after the while (even if the while 
>>>> looped ZERO
>>>> times).
>>>> But it is to be skipped if the while exited via break (and only then).
>>>>
>>>> For that reason "else" or "otherwise" are badly chosen keywords. 
>>>> Because they
>>>> imply a different function.
>>>
>>> exactly my and others' points... "and" would be better but then one 
>>> might just
>>> as easily use a goto to jump around that part if break was used to 
>>> get out of
>>> the loop...
>>>
>>> anyway, it seems that no matter what the discussion, it won't make it 
>>> into the
>>> compiler... that according to another post from a compiler dev ;)
>>
>> Maybe my remark was not clear.
>>
>> I'm not against this *functionality*.
>>
>> I merely pointed out that *the syntax using 'else'* is not going to 
>> make it
>> because it breaks backwards compatibility.
> 
> ahhhh... my bad... sorry 'bout that... i've been thinking about this, 
> too... 'else' and 'otherwise' mean the same thing... what they seem to 
> be looking for is 'aswell'...
> 
> 
> foo := 0;
> while foo < 100 do
>   begin
>     inc(foo);
>   end;
> aswell
>   begin
>     dec(foo);
>   end;
> 
> 
> either 'aswell' or 'aswellas'... while foo is less than 100 increment 
> foo as well as decrement foo when it is no longer less than 100...

If somebody really has to do this wouldn't "also" be a better choice to 
avoid (getting close to overloading "as"? :-/

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-devel mailing list