1. do-while style

Hi guys, I need a C style do/while loop or Pascal's repeat/until construct. How would the most elegant Euphoria version look like?

Thanks.

new topic     » topic index » view message » categorize

2. Re: do-while style

canadiancoder said...

Hi guys, I need a C style do/while loop or Pascal's repeat/until construct. How would the most elegant Euphoria version look like?

Thanks.

Do you need it for 3.1 or can you wait for 4.0?

In 3.1 you would use something like:

while 1 do -- do 
    body of loop 
    if <test condition> then exit -- while 
end while 

In 4.0 just follow the link: http://openeuphoria.org/docs/eu400_0013.html#[98]loopuntilstatement

new topic     » goto parent     » topic index » view message » categorize

3. Re: do-while style

LonnyNettnay said...
while 1 do -- do 
    body of loop 
    if <test condition> then exit -- while 
end while 

Argh! (Is that the correct spelling? :P) Screwed that up! Should be:

    if not <test condition> then exit -- while <test condition> is true continue the loop 
new topic     » goto parent     » topic index » view message » categorize

4. Re: do-while style

You could download Jeremy's eubins. And use them with the 3.1 libraries. They haven't removed anything YET that was in 3.1 (thanks in part for my screaming at them not to ( :) ) .

loop do 
 
-- code 
until condition 

Shawn Pringle

new topic     » goto parent     » topic index » view message » categorize

5. Re: do-while style

SDPringle said...

They haven't removed anything YET that was in 3.1

I just want to say that there has not been any intent to remove anything from 3.1 Euphoria. Version 4 will be enhancements to the language.

new topic     » goto parent     » topic index » view message » categorize

6. Re: do-while style

It turns out there was a bug in the documentation that lead to my belief that platform() would be removed. It had said so. This has been corrected:

QUOTE: The ifdef statement is much more versatile and supersedes platform(), which is supported for backward vompatibility and for a limited time only.

Sorry if I acted like a troll.

Something got my attention in the documentation. There is a SAFE define for ifdef that is defined only for Euphoria 4.00 or later. Since ifdef will only work with 4.00 or later how could this be useful? Is this another bug or have I missed something? http://openeuphoria.org/docs/eu400_0013.html#[95]ifdefstatement

ifdef SAFE 
--use 4.0 features... 
endifdef 

That cannot be the correct usage, ifdef is a 4.0 feature. What is it for then?

Shawn Pringle

new topic     » goto parent     » topic index » view message » categorize

7. Re: do-while style

SDPringle said...

Something got my attention in the documentation. There is a SAFE define for ifdef that is defined only for Euphoria 4.00 or later. Since ifdef will only work with 4.00 or later how could this be useful? Is this another bug or have I missed something? http://openeuphoria.org/docs/eu400_0013.html#[95]ifdefstatement

ifdef SAFE 
--use 4.0 features... 
endifdef 

That cannot be the correct usage, ifdef is a 4.0 feature. What is it for then?

I think the docs are incorrect. SAFE is used instead of the current technique of replacing machine.e with safe.e. Basically, you just put:

    with define SAFE 

...in your code, and you get the safe version of the memory routines.

Matt

new topic     » goto parent     » topic index » view message » categorize

8. Re: do-while style

SDPringle said...
ifdef SAFE 
--use 4.0 features... 
end ifdef 

That cannot be the correct usage, ifdef is a 4.0 feature. What is it for then?

It is correct usage, but obviously not in a pre 4.0 environment. So maybe a better example might be ...

ifdef 4_0 
--use 4.0 features... 
else 
--use 4.1 features. 
end ifdef 
new topic     » goto parent     » topic index » view message » categorize

9. Re: do-while style

SDPringle said...

It turns out there was a bug in the documentation that lead to my belief that platform() would be removed. It had said so. This has been corrected:

QUOTE: The ifdef statement is much more versatile and supersedes platform(), which is supported for backward vompatibility and for a limited time only.

Sorry if I acted like a troll.

Something got my attention in the documentation. There is a SAFE define for ifdef that is defined only for Euphoria 4.00 or later. Since ifdef will only work with 4.00 or later how could this be useful? Is this another bug or have I missed something? http://openeuphoria.org/docs/eu400_0013.html#[95]ifdefstatement

ifdef SAFE 
--use 4.0 features... 
endifdef 

That cannot be the correct usage, ifdef is a 4.0 feature. What is it for then?

Shawn Pringle

See the docs for safe.e (how to use).

Instead of swapping machine.e and safe.e, changing names and all the old way, you now only need to define SAFE using

with define SAFE 

before the first include machine.e statement.

machine.e is now only a stub which includes files based on whether SAFE and DOS32 are defined. SAFE is a reserved define tag, which the interpreter reads, but doesn't sets.

CChris

new topic     » goto parent     » topic index » view message » categorize

10. Re: do-while style

DerekParnell said...

I just want to say that there has not been any intent to remove anything from 3.1 Euphoria. Version 4 will be enhancements to the language.

Then where is misc.e in version 4.0 ?? 
If functions were move where are they ?? 

new topic     » goto parent     » topic index » view message » categorize

11. Re: do-while style

bernie said...
DerekParnell said...

I just want to say that there has not been any intent to remove anything from 3.1 Euphoria. Version 4 will be enhancements to the language.

Then where is misc.e in version 4.0 ?? 
If functions were move where are they ?? 

Bernie, we're still at pre-alpha. You can't complain about it just yet. smile

It's my understanding that the pre-4.0 include files will remain in include/.

new topic     » goto parent     » topic index » view message » categorize

12. Re: do-while style

euphoric said...
bernie said...
DerekParnell said...

I just want to say that there has not been any intent to remove anything from 3.1 Euphoria. Version 4 will be enhancements to the language.

Then where is misc.e in version 4.0 ?? 
If functions were move where are they ?? 

Bernie, we're still at pre-alpha. You can't complain about it just yet. smile

It's my understanding that the pre-4.0 include files will remain in include/.

There are hundreds of files in the archive that include MISC.E 
 
and those are being broken by moving the global routines in MISC.E 
 
file into 4 or 5 other include files. Those new include files can 
 
cause additional conflicts. 
 
All of my libraries have already been broken by variable name conflicts. 
 
Now I have additional problems being caused by changes to the original 
 
versions of the include files. 
 
What do you propose to do throw out all of the archive ?? 
 

new topic     » goto parent     » topic index » view message » categorize

13. Re: do-while style

bernie said...

There are hundreds of files in the archive that include MISC.E

and those are being broken by moving the global routines in MISC.E

file into 4 or 5 other include files.

Was I not clear about this?

From what I understand, misc.e will actually STILL EXIST when 4.0 is released. It will also exist IN THE SAME PATH. So, pre-4.0 Euphoria programs will still have access to the 3.x standard include files. There will be other compatibility issues, like if you've used 'label' or 'entry' as a variable name, but include files won't be one of them.

new topic     » goto parent     » topic index » view message » categorize

14. Re: do-while style

euphoric said...
bernie said...

There are hundreds of files in the archive that include MISC.E

and those are being broken by moving the global routines in MISC.E

file into 4 or 5 other include files.

Was I not clear about this?

From what I understand, misc.e will actually STILL EXIST when 4.0 is released. It will also exist IN THE SAME PATH. So, pre-4.0 Euphoria programs will still have access to the 3.x standard include files. There will be other compatibility issues, like if you've used 'label' or 'entry' as a variable name, but include files won't be one of them.

If you download the trunk files you will find that they contain none of 
the old include files so they must not be testing them with 3.11 includes. 
 
Some include files have the same names as original 3.11 includes 
so how does 4.0 know which include name your using in a program ???   
 
Example : 
 
MACHINE.E has added and moved some routines to other files 
WILDCARD.E moved some routines to other files 
MISC.E     moved all routines to other files 
etc. thats just some of them. 
  

new topic     » goto parent     » topic index » view message » categorize

15. Re: do-while style

The old include files from 3.1 will remain the same and will be in /include. The new standard library files will be in include/std.

If you are running a program written for 3.1, it will still work fine in 4.0 in most cases.

Note: I think there are cases when you need to mix old libraries with new ones. For example, in my FluidAE project, I'm using many of the new routines in the 4.0 standard library, but at the same time, I'm using win32lib v0.70.3 which relies on the old 3.1 libraries. No problem, it works fine.

new topic     » goto parent     » topic index » view message » categorize

16. Re: do-while style

I forgot to mention that the old libraries are not in the 4.0 pre-alpha because that would complicate things during this stage of development. When 4.0 is released, it will include them. For now, if you need them, you will have to copy them from 3.1 manually.

new topic     » goto parent     » topic index » view message » categorize

17. Re: do-while style

ryanj said...

The old include files from 3.1 will remain the same and will be in /include. The new standard library files will be in include/std.

If you are running a program written for 3.1, it will still work fine in 4.0 in most cases.

Note: I think there are cases when you need to mix old libraries with new ones. For example, in my FluidAE project, I'm using many of the new routines in the 4.0 standard library, but at the same time, I'm using win32lib v0.70.3 which relies on the old 3.1 libraries. No problem, it works fine.

OK Thanks !

new topic     » goto parent     » topic index » view message » categorize

18. Re: do-while style

bernie said...

If you download the trunk files you will find that they contain none of the old include files so they must not be testing them with 3.11 includes.

Some include files have the same names as original 3.11 includes so how does 4.0 know which include name your using in a program ???

Example :

MACHINE.E has added and moved some routines to other files
WILDCARD.E moved some routines to other files
MISC.E moved all routines to other files
etc. thats just some of them.

The 4.0 std libraries will be in include/std and the way you include them will be:

    include std/dll.e 

When we release 4.0, the old standard library will be in the include/ directory, so that 3.1 code will still have them, though they will issue deprecation warnings. We have some tools that we've been working on for migrating to use the new standard library.

Matt

new topic     » goto parent     » topic index » view message » categorize

19. Re: do-while style

Bernie,

If you use the old EUPHORIA 3.1 file tree and only replace the binaries, the only problems you should encounter are those when a new keyword conflicts with some identifier you have declared. Assuming you get yourself to a 3.1 only system: Put a directory in %EUDIR%\bin called 4.0. Then copy Jeremy's builds or someone elses as you prefer into %EUDIR%\bin\4.0. Then add that directory to the front of your path variable. Adjust your registry so that euphoria programs you start run from there also ofcourse you can decide between one or the other this way. Then I think you can run new code without the standard library. You can put the std directory from the svn as a subdirectory into %EUDIR%\include. That should allow you to use the standard library. Then you can see what the Euphoria 4.0 will look like when it is finally packaged nicely.

Shawn Pringle

new topic     » goto parent     » topic index » view message » categorize

20. Re: do-while style

SDPringle said...

Bernie,

If you use the old EUPHORIA 3.1 file tree and only replace the binaries, the only problems you should encounter are those when a new keyword conflicts with some identifier you have declared. Assuming you get yourself to a 3.1 only system: Put a directory in %EUDIR%\bin called 4.0. Then copy Jeremy's builds or someone elses as you prefer into %EUDIR%\bin\4.0. Then add that directory to the front of your path variable. Adjust your registry so that euphoria programs you start run from there also ofcourse you can decide between one or the other this way. Then I think you can run new code without the standard library. You can put the std directory from the svn as a subdirectory into %EUDIR%\include. That should allow you to use the standard library. Then you can see what the Euphoria 4.0 will look like when it is finally packaged nicely.

Shawn Pringle

The rules for assessing the visibility of global symbols have been tweaked to. You may get unusual warnings (turn them off) and occasional errors on complex multifile programs. The way namespaces work has changed a little, perhaps this can affect large programs that heavily use namespaces. These issues are probably marginal; with luck, you may even not see them at all.

CChris

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu