Re: EU feature request / Reset procedure
- Posted by Robert Craig <rds at RapidEuphoria.com> Sep 05, 2004
- 508 views
William Heimbigner wrote: > I was noticing, euphoria is missing something REALLY nice. > It would be nothing short of AWESOME if you could implement a reset > procedure. > > I.e.: > > }}} <eucode> > include win32lib.ew > -- code creation stuff > > procedure restart_onClick(integer self, integer event, sequence params) > reset() -- Exw does any internal cleanup routines > --(as tho i had exited out of the program) > -- and then reloads the program from the > files > -- on the hard drive and begins execution > end procedure > setHandler(restart, w32HClick, routine_id("restart_onClick")) > > WinMain(Window1,Normal) > </eucode> {{{ With the crash handler you'll be able to restart if you set things up right. Even now, you can effectively start over again, if you structure your program that way. > It would also be nice if you could come up > with SOME way of getting pointers to existing variables. Pointers are convenient in specific cases, but if you let them into the language, it will inevitably lead to harder to understand programs. Pointers are to data what goto is to code. Even when they aren't being used, you still have to be on the lookout for them. I like the fact that a variable's value can only change through direct assignment, not in some indirect, non-obvious way. > I would also like > define(sequence x, sequence whattype), isdefined(sequence x), and > setval(sequence x, object val). > This would allow for: > 1.) Defining a variable by name of the var and name of the type, > 2.) Testing to see if a variable has been defined, and > 3.) Setting the value of a variable based on name. > > What do you think? I don't want to introduce fancy, highly-dynamic features that can't be handled by the Translator. I put a lot of work into that Translator. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com