Hi all,
I just had a look at Frank's data structure tutorial, in which he suggests making a library abstraction for all structure templates. This seems like something I have to do for some patches I'm working on, but it would also be nice to just be able to check if the library is open, and if not, to open it.
So the question is, is there a way to check if a certain abstraction is already open?
Regards, Rich
Hallo, Rich E hat gesagt: // Rich E wrote:
I just had a look at Frank's data structure tutorial, in which he suggests making a library abstraction for all structure templates. This seems like something I have to do for some patches I'm working on, but it would also be nice to just be able to check if the library is open, and if not, to open it.
So the question is, is there a way to check if a certain abstraction is already open?
You could use a so called singleton. I'm using a crudbe, but working one in sssad which you could just grab. It's a wrapper abstraction which you call with the name of another abstraction as argument. It will make sure, that the passed abstraction is created only the first time, the singleton is used.
Frank Barknecht _ ______footils.org_ __goto10.org__
On Tue, 2007-01-30 at 15:07 -0800, Rich E wrote:
Hi all,
I just had a look at Frank's data structure tutorial, in which he suggests making a library abstraction for all structure templates. This seems like something I have to do for some patches I'm working on, but it would also be nice to just be able to check if the library is open, and if not, to open it.
So the question is, is there a way to check if a certain abstraction is already open?
if i understand right, what you want to do, implementing such a test mechanism is very easy. put this somewhere into your abstraction:
[r isitthere] | [s yesitsthere]
then you can easily check, if the library abs is open by sending a bang to [s isitthere]. when you receive a bang on [r yesitisthere], your abstraction is obviously open :-)
roman
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de