1. Open Source
- Posted by Bruce M. Axtens <bruce.axtens at gmail.com> Sep 25, 2006
- 744 views
Has anyone mentioned Creative Commons? Sorry, I haven't been lurking as regularly as I might wish. I must confess, I'm not totally convinced by the need to go open source. Check out <http://channel9.msdn.com/ShowPost.aspx?PostID=235278> where Bill Hilf discusses Microsoft's changed attitude to FOSS and why Office will never be open source. Kind regards, Bruce M. Axtens, Internal Engineer, Strapper Technologies.
2. Re: Open Source
- Posted by Al Getz <Xaxo at aol.com> Sep 25, 2006
- 664 views
Bruce M. Axtens wrote: > > Has anyone mentioned Creative Commons? Sorry, I haven't been lurking > as regularly as I might wish. > > I must confess, I'm not totally convinced by the need to go open source. > Check out <<a > href="http://channel9.msdn.com/ShowPost.aspx?PostID=235278">http://channel9.msdn.com/ShowPost.aspx?PostID=235278</a>> > where > Bill Hilf discusses Microsoft's changed attitude to FOSS and why Office > will never be open source. > > Kind regards, > Bruce M. Axtens, > Internal Engineer, > Strapper Technologies. Hi there Bruce, That video was a bit too long for me (60mins) so perhaps someone can sum up 'why' MS wont go open with Office. Thanks... Take care, Al E boa sorte com sua programacao Euphoria! My bumper sticker: "I brake for LED's" From "Black Knight": "I can live with losing the good fight, but i can not live without fighting it". "Well on second thought, maybe not."
3. Re: Open Source
- Posted by Chris Bensler <bensler at nt.net> Sep 25, 2006
- 687 views
- Last edited Sep 26, 2006
You should watch it, I thought it was insightful, and somewhat confirmed some of my own beliefs about opensource software. MS won't go open source with Office, because it doesn't fit in their business model and because it really doesn't matter. Office is one of their core assets. At the end of the day, everyone has to make money or we would have no software. Successful opensource projects make money in different ways than by protecting their intellectual property. Such as by providing paid support, a la RedHat. Interestingly, MS offers some 'shared source' licenses for developers to use. They got their team of lawyers to draw up a set of simple and concise eula's that try to allow the developers to maintain control of their code. I've had a look at them and I think they are quite good. Worth considering at least. http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx
4. Re: Open Source
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Sep 26, 2006
- 679 views
On Mon, 25 Sep 2006 13:13:24 -0700, Chris Bensler <guest at RapidEuphoria.com> wrote: >I've had a look at them and I think they are quite good. >>http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx Surprisingly short and snappy. The cynic in me wonders if this is a ruse, ie non-enforcable - it would be interesting to know whether any of these have actually been upheld in court... The succinctness of Ms_RL is interesting, in the way it bothers not to list any stuff you cannot do. [Ms_RL itself is quite prohibitively restrictive, internal and M$ only; the wording is crystal though.] Really not what I would have expected from M$ at all. Regards, Pete
5. Re: Open Source
- Posted by Chris Bensler <bensler at nt.net> Sep 26, 2006
- 661 views
Pete Lomax wrote: > > On Mon, 25 Sep 2006 13:13:24 -0700, Chris Bensler > <guest at RapidEuphoria.com> wrote: > > >I've had a look at them and I think they are quite good. > ><a > >href="http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx">http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx</a> > > Surprisingly short and snappy. The cynic in me wonders if this is a > ruse, ie non-enforcable - it would be interesting to know whether any > of these have actually been upheld in court... > > The succinctness of Ms_RL is interesting, in the way it bothers not to > list any stuff you cannot do. [Ms_RL itself is quite prohibitively > restrictive, internal and M$ only; the wording is crystal though.] > Really not what I would have expected from M$ at all. > > Regards, > Pete > > MS uses those EULA's for their shared source programs. People can get access to the Windows source code for educational or government purposes. Stuff like that.
6. Open Source
- Posted by don cole <doncole at ?acbell.?et> Oct 19, 2007
- 646 views
Now that Euphoria open source. (The answer to everything.) How come we now can't have a Goto? Don Cole
7. Re: Open Source
- Posted by Juergen Luethje <j.lue at g?x?de> Oct 19, 2007
- 652 views
don cole wrote: > Now that Euphoria open source. (The answer to everything.) How come we now > can't have a Goto? We could also ask: "Now that everyone can use tools for calculating like (s)he wants, how come that nobody uses a slide rule?". The answer to both your and my question is the same: It's obsolete, nowadays there are better tools for the regarding purpose. Regards, Juergen
8. Re: Open Source
- Posted by ChrisBurch2 <crylex at fre?u?.co.uk> Oct 19, 2007
- 643 views
don cole wrote: > > Now that Euphoria open source. (The answer to everything.) How come we now > can't have a Goto? > > Don Cole Ah, that's the beuty of open source. If you want a goto, YOU have a goto. You just have to make it yourself, and then make the source available for everyone to decide if they want it. But you've still got one. Chris
9. Re: Open Source
- Posted by Matt Lewis <matthewwalkerlewis at g?ail?com> Oct 19, 2007
- 657 views
Juergen Luethje wrote: > > don cole wrote: > > > Now that Euphoria open source. (The answer to everything.) How come > > we now can't have a Goto? > > We could also ask: > "Now that everyone can use tools for calculating like (s)he wants, > how come that nobody uses a slide rule?". > The answer to both your and my question is the same: It's obsolete, > nowadays there are better tools for the regarding purpose. Someone should tell this luser: http://lkml.org/lkml/2003/1/12/128 :P Matt
10. Re: Open Source
- Posted by Juergen Luethje <j.lue at gmx??e> Oct 19, 2007
- 656 views
Matt Lewis wrote: > Juergen Luethje wrote: > > > > don cole wrote: > > > > > Now that Euphoria open source. (The answer to everything.) How come > > > we now can't have a Goto? > > > > We could also ask: > > "Now that everyone can use tools for calculating like (s)he wants, > > how come that nobody uses a slide rule?". > > The answer to both your and my question is the same: It's obsolete, > > nowadays there are better tools for the regarding purpose. > > Someone should tell this luser: > > <a > href="http://lkml.org/lkml/2003/1/12/128">http://lkml.org/lkml/2003/1/12/128</a> > > :P Quote from that post: "I think goto's are fine, and they are often more readable than large amounts of indentation." That's the same like saying: "At night it's colder than outside." Fortunately, Linus had written some other stuff, which is considerably better. Regards, Juergen
11. Re: Open Source
- Posted by CChris <christian.cuvier at ?gr?culture.gouv.fr> Oct 19, 2007
- 642 views
don cole wrote: > > Now that Euphoria open source. (The answer to everything.) How come we now > can't have a Goto? > > Don Cole There has been sustained opposition to it in the past, on the premise that it promotes unmaintainable code. My take on this s that either: 1/ If there were more control flow structures, like exif (exit current if statement), next (evaluate next loop conditional clause), retry (reatsrt at top of loop, skip conditional clause), and if all those, as well as exit, could have an optional parameter, either a relative integer or a label string (to exit nested blocks), then goto wouldn't be needed. That would be my preference. 2/ Some will object the extra keywords. Another possibility is to have a managed goto: goto statements will need a label, so that come_from() will return which label was jumped from last, and come_back() would return to statement following last taken goto. This scheme is exposed in gretar details in the OpenEu specifications at http://oedoc.free.fr . 3/ Yet another: define a new "with RAD" directive, off by default, that would turn on constructs deemed of use at development stage only, not release stage. goto and assert() would be candidates for such constructs. 4/ And after all, I don't care. If someone can use goto effectively, it should be there; if someone uses it to release poor code, that code will be hardly maintained and will go out of sight in a darwinian way. Note that, if goto is allowed, then there must be some way to deal with a goto made inside a for loop, because of the special scoping rules for loop indexes. goto-ing into a routine should not be allowed. goto-ing into another file's top level code may be useful at times, but has issues of its own. See the goto_far statement in OpenEu specs, and also discussions on the OpenEu list on Topica. CChris
12. Re: Open Source
- Posted by Matt Lewis <matthewwalkerlewis at gmail??om> Oct 19, 2007
- 641 views
Juergen Luethje wrote: > > Matt Lewis wrote: > > Quote from that post: > "I think goto's are fine, and they are often more readable than large > amounts of indentation." > > That's the same like saying: "At night it's colder than outside." > Fortunately, Linus had written some other stuff, which is considerably > better. I don't follow your saying. It's actually a very interesting thread. Here are two of the better posts advocating gotos: http://lkml.org/lkml/2003/1/12/134 http://lkml.org/lkml/2003/1/12/252 Note: This post isn't actively advocating for gotos in euphoria--though I think there's a place for them, especially in the form of something like a "continue" statement. It's also amusing [to me] to note that much of the speed of euphoria is due to gotos. Matt
13. Re: Open Source
- Posted by Kenneth Rhodes <ken_rhodes30436 at yahoo.?o?> Oct 19, 2007
- 626 views
ChrisBurch2 wrote: > > Ah, that's the beuty of open source. If you want a goto, YOU have a goto. You > > just have to make it yourself, and then make the source available for everyone > to decide if they want it. But you've still got one. > > Chris Correction thats the beauty of of a *GNU open source license*. Rob's open source license does not require that the new source code be made available to everyone. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.0 No AdWare, SpyWare, or Viruses! Life is Good,
14. Re: Open Source
- Posted by jacques deschênes <desja at glob?trotter.net> Oct 19, 2007
- 644 views
Juergen Luethje wrote: > > don cole wrote: > > > Now that Euphoria open source. (The answer to everything.) How come we now > > can't have a Goto? > > We could also ask: > "Now that everyone can use tools for calculating like (s)he wants, > how come that nobody uses a slide rule?". > The answer to both your and my question is the same: It's obsolete, > nowadays there are better tools for the regarding purpose. > > Regards, > Juergen Don't make it a religion. "Goto" is not the devil. By the way in assembler there is only "goto" conditional ones like those that jump to a label if some flag is set or unset and unconditionnal jump. Even at call to subroutine is a goto preceded by som push an registry saving. There is a place for "goto", with or whitout "goto" a good coder stay a good coder and a bad one, a bad one. Jacques D.
15. Re: Open Source
- Posted by Juergen Luethje <j.lue at gmx?d?> Oct 19, 2007
- 630 views
jacques deschênes wrote: > Juergen Luethje wrote: > > > > don cole wrote: > > > > > Now that Euphoria open source. (The answer to everything.) How come we > > > now > > > can't have a Goto? > > > > We could also ask: > > "Now that everyone can use tools for calculating like (s)he wants, > > how come that nobody uses a slide rule?". > > The answer to both your and my question is the same: It's obsolete, > > nowadays there are better tools for the regarding purpose. > > > > Regards, > > Juergen > > Don't make it a religion. "Goto" is not the devil. By the way in assembler > there is only "goto" I do not make it a religion. Please do not put words into my mouth. I just say that it's obsolete in high-level languages. This is of course only true if a language provides sufficient other possibilities. For instance in Euphoria, it would be useful not only to have an 'exit' statement, but also the possibility to write something like exit <number of levels> > conditional ones like those that jump to a label if some flag is set or unset > and unconditionnal jump. Even at call to subroutine is a goto preceded by som > push an registry saving. > > There is a place for "goto", with or whitout "goto" a good coder stay a good > coder and a bad one, a bad one. > > > Jacques D. Regards, Juergen
16. Re: Open Source
- Posted by Matt Lewis <matthewwalkerlewis at gma?l.co?> Oct 19, 2007
- 665 views
Juergen Luethje wrote: > > I do not make it a religion. Please do not put words into my mouth. > I just say that it's obsolete in high-level languages. This is of > course only true if a language provides sufficient other possibilities. > For instance in Euphoria, it would be useful not only to have an 'exit' > statement, but also the possibility to write something like > > exit <number of levels> I've often thought this, too, although that construct worries me. What happens if the levels change? Even if they don't change, it's not trivial to figure out the target of that exit. A label-based exit, OTOH, can be very useful, and explicit. For example, perl allows you to name a block (which could be a while/for/etc) and to use the next/last operators along with the block name: http://en.wikipedia.org/wiki/Perl_control_structures A euphorian implementation might look like:
:mainloop for i = 1 to n do ... :jloop for j = 1 to m do .... if foo then exit :mainloop end if while foo > 5 do ... if bar then exit :jloop end if ... end for end for
That keeps the labels firmly associated with their proper loops. It makes the goal very clear, although at the expense of clarity of where you're going:
for i = 1 to n do ... for j = 1 to m do .... if foo then goto :mainloop end if while foo > 5 do ... if bar then goto :jloop end if ... end for :jloop end for :mainloop
I can see benefits to both ways, though I think I would prefer keeping them associated with the loop. It's also how exits work right now. Matt
17. Re: Open Source
- Posted by Al Getz <Xaxo at a?l.?om> Oct 19, 2007
- 677 views
jacques deschênes wrote: > > Don't make it a religion. "Goto" is not the devil. By the way in assembler > there is only "goto" > conditional ones like those that jump to a label if some flag is set or unset > and unconditionnal jump. Even at call to subroutine is a goto preceded by som > push an registry saving. > > There is a place for "goto", with or whitout "goto" a good coder stay a good > coder and a bad one, a bad one. > > > Jacques D. Hi there, The Curse of the Goto I have to disagree here. A bad 'coder' stays a bad coder with the continued use of gotos, but he/she gets better without the use of the goto. I used to think that gotos should not be used by beginning programmers until they have done a significant body of code, and then they will have the experience to realize the benefits and pitfalls. I might be changing my stand on this however, because who can say that at the end of the day when they run into a big structuring problem, that they dont stick in a goto somewhere where it really shouldnt be? "I'll get back to restructure that section of code at a later date, soon". Then another goto, then another, then another. It's too tempting sometimes to stick in a goto rather than restructure a whole section of code. Restructure might take hours, a goto maybe 10 seconds...who here can fight that urge each and *every* single time this comes up? If you have the discipline to use gotos only inside a loop or within a short body of code alone where the readability actually gets better, then good for you. Many wont be able to do this when faced with a tough dilemma that gets solved in a flash with a single (and ill placed) goto. Sometimes the fastest way home is not the safest. If this doesnt convince or at least show the main reasoning behind the pitfalls of the goto, then i will shut up and allow you to take on the Curse of the Goto for as long as you like. Use gotos as freely (or not) as you like, but when the Curse of the Goto rears up and bites you on the backside, dont come back and claim that nobody warned you. Take care, Al E boa sorte com sua programacao Euphoria! My bumper sticker: "I brake for LED's" From "Black Knight": "I can live with losing the good fight, but i can not live without fighting it". "Well on second thought, maybe not."
18. Re: Open Source
- Posted by jacques deschênes <desja at glo?etr?tter.net> Oct 19, 2007
- 651 views
Al Getz wrote: > > jacques deschênes wrote: > > > > Don't make it a religion. "Goto" is not the devil. By the way in assembler > > there is only "goto" > > conditional ones like those that jump to a label if some flag is set or > > unset > > and unconditionnal jump. Even at call to subroutine is a goto preceded by > > som > > push an registry saving. > > > > There is a place for "goto", with or whitout "goto" a good coder stay a good > > coder and a bad one, a bad one. > > > > > > Jacques D. > > Hi there, > > > The Curse of the Goto > > > I have to disagree here. A bad 'coder' stays a bad coder with the continued > use of gotos, but he/she gets better without the use of the goto. > > I used to think that gotos should not be used by beginning programmers > until they have done a significant body of code, and then they will have > the experience to realize the benefits and pitfalls. I might be changing > my stand on this however, because who can say that at the end of the > day when they run into a big structuring problem, that they dont stick > in a goto somewhere where it really shouldnt be? "I'll get back to > restructure that section of code at a later date, soon". Then another > goto, then another, then another. It's too tempting sometimes to > stick in a goto rather than restructure a whole section of code. > Restructure might take hours, a goto maybe 10 seconds...who here can > fight that urge each and *every* single time this comes up? > If you have the discipline to use gotos only inside a loop or within > a short body of code alone where the readability actually gets better, > then good for you. Many wont be able to do this when faced with a tough > dilemma that gets solved in a flash with a single (and ill placed) > goto. Sometimes the fastest way home is not the safest. > > If this doesnt convince or at least show the main reasoning behind > the pitfalls of the goto, then i will shut up and allow you to take on > the Curse of the Goto for as long as you like. Use gotos as freely > (or not) as you like, but when the Curse of the Goto rears up and bites > you on the backside, dont come back and claim that nobody warned you. > > > Al > > E boa sorte com sua programacao Euphoria! > > > My bumper sticker: "I brake for LED's" > Since 1974 I have programmed in many languages including assemblers and rarely feeled the need for a goto (execpt in asm). In euphoria the only times I feel the need for it is because of the lack of error handling like there is is Java,C# or delphi. What I'm saying is that under the hood every thing is a goto as this is the only thing that exist at cpu level and that I'm agains any dogma. If I had to choose between a "goto" or a "try-fail-finally" error handling machanism like there is in Delphi I would choose the last one. regards, Jacques Deschênes
19. Re: Open Source
- Posted by ChrisBurch3 <crylex at gma?l.com> Oct 19, 2007
- 634 views
- Last edited Oct 20, 2007
Kenneth Rhodes wrote: > > ChrisBurch2 wrote: > > > > Ah, that's the beuty of open source. If you want a goto, YOU have a goto. > > You > > > > just have to make it yourself, and then make the source available for > > everyone > > to decide if they want it. But you've still got one. > > > > Chris > > Correction thats the beauty of of a *GNU open source license*. Rob's > open source license does not require that the new source code be > made available to everyone. > Heh heh Neither does that sentence. (Time flies like an arrow. Fruit flies like a banana.) Cheers Chris > Ken Rhodes > Folding at Home: <a > href="http://folding.stanford.edu/">http://folding.stanford.edu/</a> > 100% MicroSoft Free > SuSE Linux 10.0 > No AdWare, SpyWare, or Viruses! > Life is Good,
20. Re: Open Source
- Posted by Juergen Luethje <j.lue at g?x.d?> Oct 20, 2007
- 671 views
- Last edited Oct 21, 2007
Matt Lewis wrote: > Juergen Luethje wrote: > > > > Matt Lewis wrote: > > > > Quote from that post: > > "I think goto's are fine, and they are often more readable than large > > amounts of indentation." > > > > That's the same like saying: "At night it's colder than outside." > > Fortunately, Linus had written some other stuff, which is considerably > > better. > > I don't follow your saying. It's actually a very interesting thread. Sorry, I hadn't read the whole thread, but only the one post that you had mentioned. > Here are two of the better posts advocating gotos: > > http://lkml.org/lkml/2003/1/12/134 In this post #134, the author writes: | | *judicious* use of goto can prevent code that is so cluttered with stuff [...] | I often have read something like that from people who are advocating "goto". That might be correct -- but after my experience, reality very often is different. When people say so, that reminds me of a funny situation here in Germany. We have a newspaper here, the content of which is on a level similar to the British "The Sun" -- not exactly the stuff you need to read when you are preparing your doctoral thesis. When you ask people in Germany, you'll come to the conclusion that all people agree that this newspaper is "trash", and that nobody does read it. The funny thing only is, that more than 3 million copies of it are sold daily ... This is somewhat similar to my experience with "goto". People who are advocating "goto" say it should be used "judicious", and they themselves of course are doing so. But when I look "in the wild", then I see something different. I know what I'm talking about, after having read literally Megabytes of PowerBASIC (which has a "goto" statement) source codeby many different authors. So althought there may be some rare situations when "goto" might be of some use (I never encountered such a situation, and I never needed to use "goto" with PowerBASIC.), according to my experience, in the overwhelming majority "goto" is used to produce spaghetti code, which is hard to read an to maintain. Of course it's also possible to write bad readable and bad maintainable code *witout* "goto" (as I have learned from the archieves, this is even possible with Euphoria), but "goto" makes this job *a lot* easier. In the same post above, it reads: | | The real problem is that C doesn't have a good multi-level "break" construct. | I can't actually say much about C, but the author seems to share my opinion: That "goto" is not necessary, when a language has good "modern" possibilities for controlling the program flow. Then it reads: | On the other hand, I don't know of any language that has a good one - some | allow "break 3;" to break 3 levels- but that's still bad because you get | screwed if somebody adds an 'if' clause.... Why will we get screwed if somebody adds an if clause? I don't understand that. Anyway, if "break n" oder "exit n" is not sufficient, then we should think about even more advanced statements, rather then using "goto", which simply has a bad use/risk ratio. > http://lkml.org/lkml/2003/1/12/252 > > Note: This post isn't actively advocating for gotos in euphoria-- I'm aware of that. > though > I think there's a place for them, especially in the form of something > like a "continue" statement. I'd actually appreciate a "continue" statement (which jumps from anywhere inside a loop to its beginning), too. Please note that this is not what I mean when I talk about "goto". With "goto" I mean a statement that allows to jump to (almost) every point in the code -- like "jmp" in assembler. > It's also amusing [to me] to note that > much of the speed of euphoria is due to gotos. I think it is in the C source code of the interpreter/translator, no? Don asked about "goto" *in Euphoria code*. I use conditional and unconditional jumps myself, when I do ASM programming. But I only use ASM code for small pieces of code, where speed is important. And I only write ASM programs, when I have slept very well the night before. I do not expect ASM code to be good readable or easily maintainable. That's the difference to a higher-level language like Euphoria. In my opinion, "goto" is obsolete *in such higher-level languages* -- not in lower-level languages such as C or ASM. Code in higher-level languages should be easy to read and maintain, they should allow the coder to concentrate on the problem he wants to solve. The language itself should be part of the soöution, not part of the problem. Regards, Juergen -- I didn't have time to write a short letter, so I wrote a long one instead. [Mark Twain]
21. Re: Open Source
- Posted by don cole <doncole at pacb?ll?net> Oct 20, 2007
- 653 views
- Last edited Oct 21, 2007
I didn't know it was going to be this much of a problem. Let's just forget Goto. Don Cole
22. Re: Open Source
- Posted by Jason Gade <jaygade at ?ah?o.com> Oct 20, 2007
- 664 views
- Last edited Oct 21, 2007
don cole wrote: > > I didn't know it was going to be this much of a problem. > > Let's just forget Goto. > > Don Cole Don't give up so easily -- it's been a contentious issue for as long as I can remember. At least as contentious, if not more so, than the way that include files and global variables should be handled. BTW, well-written post above, Juergen. I also kind of liked Jacques' post above regarding exception-handling mechanisms. There should be a simple, Euphorian way to do that. I just don't know what it is right now. One suggestion: change the existing "exit" statement to optionally allow a label and to work in both loops and if statements. You get 99% of the functionality of the goto. I also like the idea of "continue <label>" or "next <label>" where label is an optional identifier at the beginning of a loop. But I haven't given it too much thought. As for handling tail-recursion? I have no idea. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.
23. Re: Open Source
- Posted by Andy Drummond <andy at kestre??ele.com> Oct 22, 2007
- 642 views
Jason Gade wrote: > > I also like the idea of "continue <label>" or "next <label>" where label > is an optional identifier at the beginning of a loop. But I haven't given it > too > much thought. > I would like to suggest three additions to the syntax of Euphoria which would get around 99% of the desire for a goto. Nothing new but as suggested above: next var -- Go to the iteration point of the for loop for this variable exit var -- Ditto but exit the loop redo var -- Ditto but re-run the loop without iterating the variable For nested loops the interpreter would have to release variables which were out of scope, but that is simple enough. If you have three nested loops using I, J & K, say, and in the middle had "next I", then that would be coded as exit K; exit J; next I;
for i=1 to 10 do for j=1 to 10 do for k=1 to 10 do if some condition met then next i -- effectively: exit k -- exit j -- next i end if end for end for end for
These three would make the nested loop control much easier to code and much easier to read. And the desire for goto would almost vanish. Most people who ask for goto statements want them for exiting nested loops, it seems to me. Any suggestions? Anyone able to add these to the interpreter? Andy Drummond
24. Re: Open Source
- Posted by CChris <christian.cuvier at a?ric?lture.gouv.fr> Oct 22, 2007
- 669 views
Andy Drummond wrote: > > Jason Gade wrote: > > > > I also like the idea of "continue <label>" or "next <label>" where label > > is an optional identifier at the beginning of a loop. But I haven't given it > > too > > much thought. > > > > I would like to suggest three additions to the syntax of Euphoria which would > get around 99% of the desire for a goto. Nothing new but as suggested above: > > next var -- Go to the iteration point of the for loop for this variable > exit var -- Ditto but exit the loop > redo var -- Ditto but re-run the loop without iterating the variable > > For nested loops the interpreter would have to release variables which were > out of scope, but that is simple enough. If you have three nested loops > using I, J & K, say, and in the middle had "next I", then that would be coded > as exit K; exit J; next I; > > }}} <eucode> > for i=1 to 10 do > for j=1 to 10 do > for k=1 to 10 do > if some condition met then > next i > -- effectively: exit k > -- exit j > -- next i > end if > end for > end for > end for > </eucode> {{{ > > These three would make the nested loop control much easier to code and much > easier to read. And the desire for goto would almost vanish. Most people who > ask for goto statements want them for exiting nested loops, it seems to me. > > Any suggestions? Anyone able to add these to the interpreter? > > Andy Drummond Your approach only works for for-loops, not for while-loops. However, I can add the loop variable as an extra possible argument to exit/next/retry which work in my modified interpreter - see my reply to the first post from Don Cole-. Only the front end needs be modified: * next and retry translate to ELSE adequate_target * Patch[E|X]List() handles delayed block exits, otherwise do business as usual. Hiding the loop var is done at end of for loop, unchanged. The other constructs I parse are: * exit 1 (exit loop above), 2 (two loops above), ... -1 (all loops), -2 (all loops but the topmost),... exit 0 is the same as exit. * exit some_string, where the loop has been labelled with some_string. * The way I add labels is as follows: for i=1 to n [by 2] [label "my string"] do if <some_condition> label "my block" then I have no qualms changing "retry" to "redo". "continue" seems a little ambiguous to me, which is why I prefer "next" over it, but it's not much of an issue. I also have an "exif" statement which exits (nested) if blocks, same syntax enhancements. CChris
25. Re: Open Source
- Posted by Andy Drummond <andy at k?s?reltele.com> Oct 22, 2007
- 658 views
> > > > I would like to suggest three additions to the syntax of Euphoria which > > would > > get around 99% of the desire for a goto. Nothing new but as suggested above: > > > > next var -- Go to the iteration point of the for loop for this > > variable > > exit var -- Ditto but exit the loop > > redo var -- Ditto but re-run the loop without iterating the variable > > > > For nested loops the interpreter would have to release variables which were > > out of scope, but that is simple enough. If you have three nested loops > > using I, J & K, say, and in the middle had "next I", then that would be > > coded > > as exit K; exit J; next I; > > > > }}} <eucode> > > for i=1 to 10 do > > for j=1 to 10 do > > for k=1 to 10 do > > if some condition met then > > next i > > -- effectively: exit k > > -- exit j > > -- next i > > end if > > end for > > end for > > end for > > </eucode> {{{ > > > > These three would make the nested loop control much easier to code and much > > easier to read. And the desire for goto would almost vanish. Most people who > > ask for goto statements want them for exiting nested loops, it seems to me. > > > > Any suggestions? Anyone able to add these to the interpreter? > > > > Andy Drummond > > Your approach only works for for-loops, not for while-loops. > However, I can add the loop variable as an extra possible argument to > exit/next/retry > which work in my modified interpreter - see my reply to the first post from > Don Cole-. Only the front end needs be modified: > * next and retry translate to ELSE adequate_target > * Patch[E|X]List() handles delayed block exits, otherwise do business as > usual. > Hiding the loop var is done at end of for loop, unchanged. > > The other constructs I parse are: > * exit 1 (exit loop above), 2 (two loops above), ... -1 (all loops), -2 (all > loops but the topmost),... exit 0 is the same as exit. > * exit some_string, where the loop has been labelled with some_string. > * The way I add labels is as follows: > for i=1 to n [by 2] [label "my string"] do > if <some_condition> label "my block" then > > I have no qualms changing "retry" to "redo". "continue" seems a little > ambiguous > to me, which is why I prefer "next" over it, but it's not much of an issue. > I also have an "exif" statement which exits (nested) if blocks, same syntax > enhancements. > > CChris I hadn't appreciated that you were producing a version of the interpreter, CChris, so if you do I should be very pleased to sample it in due time. I have had a number of loops - and yes, I almost always use for loops rather than while loops because the latter needs some setup before they commence - in which I need to exit the loop partway through. The if is easier but would gain from some kind of multiple level exit route - your exif would be useful. I have to say I am less impressed with the labelling system, though I can see the reason behind it; it just smacks of the old goto system which I am sure someone will want extended to become a full goto. Not a nice prospect. I understand the change is only a front-end change, but it is the front-end code which is hardest to sort out. Would Rob be interested in having this kind of code change being incrporated into the official Euphoria? If the phrase is meaningful now it is open-source and every Tom Dick & Harry can produce his own flavour! We've gone from (benign) dictatorship to design by committee! AndyD
26. Re: Open Source
- Posted by don cole <doncole at ?acbe?l.net> Oct 23, 2007
- 629 views
I haven't used basic for so long. I don't know what I used goto for. But for Euphoria I would think you need new command exitAllGoto. for repeated gotos inside the loop use gosub or in our case procedure or function. logical progression --step [1]-- --step [2]-- loop a loop b loop c condition met exitAllGoto step[4] --step [3]-- --step [4]-- Don Cole
27. Re: Open Source
- Posted by Robert Craig <rds at ?apidE?phoria.com> Oct 23, 2007
- 649 views
Andy Drummond wrote: > ... Would Rob be interested in having this kind of > code change being incrporated into the official Euphoria? If the phrase > is meaningful now it is open-source and every Tom Dick & Harry > can produce his own flavour! > We've gone from (benign) dictatorship to design by committee! Yes we have! I will not veto any change that gets majority support. I will only cast a single vote, equal to anyone else. I think "qualified" users should each have one vote. http://www.rapideuphoria.com/economy.htm (And of course, some person capable of doing the work has to be in favor of a change, if it is ever going be done.) I would hate it if a general GOTO were added, but I would not be too upset about some other more restricted, structured statement being added, though I have only had a few instances where I felt it would be useful. I'll comment on your specific proposal if it ever goes to a vote. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com