Re: no GOTO
- Posted by "Igor Kachan" <kinz at peterlink.ru> Nov 24, 2004
- 504 views
Don Cole wrote: > Can't the lack of GOTO in Euphoria be woker around with PROCEDURE which is > really GOSUB. These GOTOs in the Basic programs is one of hardest things for translation the old Basic programs into Euphoria. Programmer needs to rethink all Basic goto algorithms in terms of procedures, functions, Euphoria loops etc. There is no another way. But if that rethinking is done, Euphoria program shines! Rob keeps Euphoria without goto to avoid the simple replaceing of Basic crazy gotos by Euphoria crazy gotos. *Any* Euphoria program must shine, I do understand Rob. Euphoria is a new excellent high-level language for the modern and perspective End User. Goto operator is good simetimes for complicated low-level languages. > I have often thought about writing a Euphoria to Basic library for people > familiar with basic but new to Euphoria. > > For example my VAL() > > }}} <eucode> > global function getdec(sequence seq) --returns a decimal given a sequence > atom de > sequence value_string > value_string=value(seq[1..length(seq)]) > de = value_string[2] > return de > end function > > </eucode> {{{ I have some little experince about translation Basic to Euphoria. Why not to keep the almost Basic's syntax for such the library? Say,
global function VAL(sequence s) -- real code end function
Then Basic user can just write almost Basic program in Euphoria. I'm working on Basic/Euphoria DRAW procedure now and it is almost ready. Works for me on all SVGA Euphoria DOS32 modes. I'll submit it when it's ready. Rob has this my DRAW lib for testing with 2.5. > There's my first contributation. Somebody should add it. Good Luck! Regards, Igor Kachan kinz at peterlink.ru