Re: Internal suroutines
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 06, 2003
- 384 views
----- Original Message ----- From: "Peter Lynch" <plynch49 at hotmail.com> To: "EUforum" <EUforum at topica.com> Subject: RE: Internal suroutines > > > If your premise is that clarity is reduced by the use of an internal or > sub-procedure, then i have to disagree. No, this is not what I meant. Using a sub-procedure is generally a good thing, but its the ability to fall-thru to a labelled statement that causes some concerns. > Gosub vs Goto is the equivalent of > Perform vs Goto in COBOL > RTJ vs JMP in assembler Agreed. And Gosub is equivalent to Euphoria's call statement when used without parameters. > > There are difficult issues of scope in implementing sub-procedures, but > at present if i want to encapsulate anything i need to put it in a > separate 'process'. Good. This is a useful thing to do. > I dont want to see the particular element GOSUB, but i wonder if > anybody else sees the value of allowing arbitrary decomposition of > functional primitives - sometimes they can be quite long, and are > obscured simply by the number of levels of logic in them. > Sub-procedures allow a further refinement of the decomposition process, > which is i believe the basis of software implementation. My premise is that Euphoria already has such a facility, only with three differences - You can't fall-thru to Eu procedures (a good thing) and you can't refer to a procedure that occurs further down in the source code (a not-so-good thing), and you can pass the routine parameters (a good thing). -- Derek