[DGD] Re: Parse String and Virtual Objects
S. Foley
s_d_foley at hotmail.com
Mon Dec 10 03:21:09 CET 2001
Regarding parse_string():
This function really isn't too hard to figure out, though the effort
required is something north of 'none'. I have no formal training in the
computer sciences or any programming language and through a combination of
the list archives, web searches on grammars, and trial and error use of the
actual function, I was able to figure it out (and as bulbs go, I'm not
particularly bright ;) ). After making that kind of effort, you should be
in a position to ask more specific questions about parse_string. And, in
general, the list is more responsive to specific questions, since they
indicate that you've at least made some effort to understand things on your
own, and beyond that, they don't require a veritable textbook to answer.
When I've posted specific questions regarding parse_string to this list,
they have been answered quickly, completely, and politely.
---
Arnau,
By virtual objects, do you mean objects with objects names that do not
correspond to any actual existing file? If so, I believe the solution to
your problem is much simpler. The compile_object() help file states:
"Compile an object from a LPC file, specified by the argument string
with ".c" appended. The returned object will have the argument string
as name."
So, you could do something like check for the existence of a file
corresponding to the first argument passed into compile_object. If a file
didn't exist, you could pass the argument off to another daemon that could
generate an appropriate object for the name specified and return it back
into compile_object() (which would then do whatever it needed to with the
object, before returning it). I *think* this object could even be a clone.
I'm not certain what impact this might have on your ability to upgrade
objects, but I *think* an object registration daemon written with this
behavior in mind could accomodate it. This would obviate the need for your
mapping, as well as the need to add in extra checks to call_other, et.al.
I haven't actually tried this, so if I'm wrong hopefully someone on the list
will correct me. And even if what I suggest is possible, perhaps someone
could chime in on the drawbacks to this design. I know a few concerns leap
immediately to my mind.
--Steve F.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list