Re: overriding vs namespaces
- Posted by Arthur Crump <arthur.crump at nt?world.co?> May 16, 2008
- 573 views
For overriding existing routines, can I suggest a new Euphoria keyword: Forget open This could be used on variables as well as routines. Arthur Crump Matt Lewis wrote: > > Kat wrote: > > > > It allows for minimal changes to existing code, does not break existing > > code, > > and is the ONLY method for "overloading" an internal function, in my > > proposal. > > For instance, this would be illegal: > > }}} <eucode> > > junk = open(blah) -- as an override of internal open() > > </eucode) > > this would be legal inside ftp.e (for example): > > }}} <eucode> > > junk = ftp_open(blah): export as "open" > > </eucode> {{{ > > so it can be used like > > }}} <eucode> > > include ftp.e as ftp > > ftp:open(someplace online) > > </eucode> {{{ > > Actually, this would break some existing code: > }}} <eucode> > -- print.e > global procedure print(...) > > -- app.ex > include print.e > > print(...) > </eucode> {{{ > > Matt