Re: [Oopic-compiler-devel] more of 'background' ala Dan Sandberg
Status: Planning
Brought to you by:
ndurant
From: Neil D. <nd...@us...> - 2004-05-06 10:51:09
|
Yahoo Junk wrote: > Neil, > > > But what would "background" actually mean to the function? The OOPic > > can't execute these functions in the background, so it could be > > misleading. > > The 'background' would be nothing more than a script syntax to clearly > identify that this bit o' script is (part of) a virtual circuit. Perhaps > another token could be used, such as 'virtual_circuit'. The thought is to > clearly seperate in the syntax the VC stuff from the slower scripted stuff. > That division would have helped me grasp the VC concept sooner; maybe it > would help others too (I'm recalling Scotts comment that at Trinity > Firefighting none of the OOpics were using VC). Again, it could be misleading because the code in those 'background' functions are normal script, and running at normal slow script speed. Also, suppose you have one of these background functions that gets called when some virtual circuit triggers an event. There's nothing to stop you calling an 'ordinary' function from within that 'background' function, which blurs the line between the background stuff and the ordinary stuff. > > Are you suggesting that basically the above example would translate > > into an oWire and an oEvent, triggered by the button press? If so, > > then it's a nice idea, and cleans up the messy way you have to wire up > > oEvents. > > I'm not sure at all about whether I mean that. <grin> I'm a VC novice. > > I actually was looking for a possible syntax to seperate VC from the rest. I don't think you can though, because the code you'd be putting in a VC is still ordinary script. > > The thing I dislike about this syntax is that the use of "background" > > implies that the first statement in the function must be an "if", which > > seems a bit kludgey to me. Unless I'm misunderstanding you. > > Your event_table idea is attractive. > > Would there be (asks the VC ignorant guy) situations where a VC would > simply need to be setup and it runs autonomously? Even then, I suppose > that an .Operate interface might be required/desired. Yes, I would say this is a standard use of VCs. Quite often you call a setup() function in your script at startup that wires up the VCs, call .Operate() on them, to get them going, and then leaves them to do their work. Not all VC setups need to trigger events in script code. And in an ideal world, programs would call setup() and then end because all of the functionality would be handled within VCs, with no calling of script code at all. Neil -- Neil Durant <nd...@us...> |