Re: Euphoria 2.5 Will Break Existing Code

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

Al Getz wrote:

> Juergen Luethje wrote:
>>
>> Igor already gave you a hint. He was meaning this:
>>
>>
>> http://www.listfilter.com/cgi-bin/esearch.exu?fromMonth=2&fromYear=9&toMonth=2&toYear=9&postedBy=Juergen+Luethje&keywords=advantage
>>
>>
>> Regards,
>>    Juergen
>>
>
> Hello Juergen,
>
> Thanks for the info, i didnt get that post on the web interface
> as usual, another nice feature.  Who's idea was it to move
> to this Topica again?

I don't know. This happened before I joined the Euphoria community.
Please remember, that this is a mailing list, not a web forum.
Topica's web interface is just an additional feature.
However, my post mentioned above *can* be found on Topica's web
interface:
http://www.topica.com/lists/EUforum/read/message.html?mid=1716039409

> Anyway, i like the idea and ive considered also the following:
>
>
> Part1.exw:
>
> constant fname="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.txt"
> x=readflag(fname) --originally set to 1
> if x=1 then
>     writeflag(fname,0)
> else
>     writeflag(fname,1)
> end if
>
> y=determine_y() --based on platform or other requirements
>
> if x>0 then
>     --do writes
>     if y=1 then writecode1("Incl.ew") system(ExecutePart1,2) abort(0)
>     elsif y=2 then writecode2("Incl.ew") system(ExecutePart1,2) abort(0)
>     end if
>     --else execute code
> end if
> include Incl.ew
> DoRemainderOfProgram()
>
>
> Incl.ew:
>
> --code written by writecodeN:
> -- --whatever, code 1 or code 2--

Sorry, I don't understand how the code above would work. It uses the
routines readflag(), writeflag(), and determine_y(), but I don't know,
what these routines will do.

However, the basic principle will be in any case, that the code that
produces the include file(s), and the code that include these include
file(s), reside in different program files.
Dynamically producing code, and then using this code, are 2 different
steps anyway. Euphoria version 2.5 will force us, to implement these
2 different steps in 2 different files. The resulting code might even
be better readable than the old code, especially for newcomers.
I'm also thinking of the old 'Bauhaus' motto, which I like very much:
"Form follows function."

> But, alas, the main point was that before 2.5 the dynamic includes
> already work.  Also, i assumed the nature of the mechanics of the
> includes would get BETTER, not WORSE, with time as Euphoria
> progressed, making it EASIER not HARDER to use.
>
> The above seems to achieve conditional includes, but see how
> much more complicated it is to implement?

Using Eu 2.5, dynamic includes will work, too. Rob has confirmed it.
I don't join your judgement, that the new mechanism for dynamically
including files will be worse than the old one. It might be even
clearer.

Yes, I see how complicated your code above is. But I do not see, why it
should be necessary to implement dynamic includes that complicated. smile
When you look again at my regarding post, I think you'll see that it
should be fairly simple, and only a few changes in the old code are
required.


> Wouldnt this be nice:
>
> if y=1 then
>     include Incld1.ew
> else
>     include Incld2.ew
> end if
>
> Five lines vs whatever lines it took to do it above.

I absolutely agree, that this would be nice. But it's a request for a
new feature, and so it's a completely different topic.

Regards,
   Juergen

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

Search



Quick Links

User menu

Not signed in.

Misc Menu