Re: Help with plugin concept
- Posted by Robert Craig <rds at RapidEuphoria.com> Feb 14, 2004
- 686 views
Pete Lomax wrote: > I cannot however resist suggesting (in pseudo code rather than true or > tested Euphoria, you understand): > > in say misc.e: > procedure dynamic_include(sequence filename, sequence contents) > integer changed, fn, > object d > if interpreting or translating then -- see PS > changed=0 > d=dir(filename) --##I forget the syntax/results## > if d!=-1 and d[SIZE]=length(contents) then > fn=open(filename,"r") > for i=1 to length(contents) do > if getc(fn)!=contents[i] then > changed=1 > exit > end if > end for > close(fn) > if changed=0 then return end if > end if > open(filename,"w") > puts(fn,contents) > close(fn) > puts(1,"dynamic include changed; restarting...") > system(command_line()) > abort(0) > end if > end procedure > > then: > dynamic_include(filename,contents) > include filename > > Does that make sense? > If so, I don't think it is much work and it will (might) put this > issue to bed once and for all. > > Regards, > Pete > PS I am undecided whether it would be better for bind/translate to > simply not generate any code whatsoever for the dynamic_include() > call, or issue a fatal error (/warning) if it detects the program > ought to be re-bound/re-translated. That's an interesting idea. A bit convoluted though. I think I'll wait and see if anyone starts screaming about this issue when the new interpreter is released. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com