Re: WISHLIST.TXT

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hello,

Christian <christian.cuvier at education.gouv.fr> wrote:

> ----- Original Message -----
> From: "Juergen Luethje" <jluethje at gmx.de>
> To: "EUforum" <EUforum at topica.com>
> Subject: Re: WISHLIST.TXT
>
>> Christian <christian.cuvier at education.gouv.fr> wrote:
>>
>> <snip>
>>> Resume statement:
>>>    A "resume" statement would give control to the first statement in
>>> a loop, performing the operations that an *end loop* normally would.
>>> After all, a new keyword is not even necessary: end while and end
>>> for can be uesd just as well.
>>
>> I'm afraid I didn't understand what you mean. Could you please give
>> an example?
>
>     Hi!
>     The *end for* or *end while* statements - I'll call them *end loop* -
> return control to the top control statement in the loop (the *for* or
> *while* thing, with condition testing and everything).
>     In Euphoria, *end loop* statement can appear only as the closing
> statement of the loop.
>     My suggestion is that it could appear anywhere inside the loop,
> returning control as described above.
>
>     In other languages, this functionality is assumed by specific keywords:
> *resume* (SAS), *iterate* (some Basics), *continue* (C)... . My observation
> was that a new keyword is not needed, just extend the availability of an
> existing one.

Thanks for the additional explanation, now I understand what you mean
(I know the ITERATE keyword). I agree that such an additional keyword
could be nice in some cases.

>     So, instead of writing

> while <cond1> do
>     ...
>     if not(<cond2>) then
>         ...
>         if not(<cond3>) then
>             ...
>         end if
>     end if
> end while
>
> you'd have the much cleaner, and completely synonym:
>
> while <cond1> do
>     ...
>     if <cond2> then end while end if
>     ...
>     if <cond3> then end while end if
>     ...
> end while

I wouldn't go so far to say "much cleaner", but at least not so deeply
nested. On the other side, for someone who is not familiar with this
statement, maybe it could look *less* clean?

> If it is a problem to tweak the interpreter into understanding this use of
> *end loop*,

I don't know if it's a problem for the interpreter ...

> then one of the other known keywords (*resume* is shorter) could
> be introduced for this specific purpose.

... but this should be done at least for human readability!
I cannot say it better than Derek. He wrote:
"currently in Euphoria, the 'end while' statement is a place
marker to tell the interpreter where a loop block ends. It is not an
action statement that tells the interpreter to do something."

Using "end for/end while" for different purposes can (and did already)
cause much confusion, and would considerably reduce the readability of
the source code.

> Clearer?

Regards,
   Juergen


PS: I don't know, where the following text came from, and how it came
    inside your reply. Formally it looks, as if the following text which
    is quoted with ">>", was part of my previous post. This is not the
    case, nothing of the following was written by me.

    
> BTW: on dubetyrant statement:

>>7.That darn interpreter is reliable.Adding all kinds of new complexity
>>could jeopardize the stability of the thing,that wouldn't be good.

> Obviously, stability is an issue, and that's why I said resisting too change
> is not unhealthy by itself. Some features may never be mplemented, although
> they would be very convenient, for this very reason.

> Frankly, I think that 90% of what I'm suggesting cannot compromise Euphoria
> interpreter stability in any way. As for the remaining 10%, I don't know. I
> paid special attention in seeing to it that nothing proposed could break
> existing code.

> The "Not planned in any future" section I suggested could state some of
> these features that might be too risky to implement, with a sketch of the
> reason why. Careful reading could then clarify issues and give a better
> understanding of how Euphoria works, which will mean better Euphoria coding.

>>2.Loops.I have found that the while,if,for loops work for anything
>>I need,and quickly too.

> Hey, very smart people coded marvelous things in Fortran77 30 years ago.
> Want to use this again? It is most of the time a matter of convenience in
> writing and code readability and maintainability.

> After all, one could say: Euphoria can interface with C and ASM, so do any
> advanced trickery through this interface. I don't think it is either clean,
> desirable or secure, but it may work...

> Best regards.

> Chris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu