[DGD]parse_string

Jason Cone jcone at usabilitysciences.com
Tue Apr 6 15:31:00 CEST 1999


> -----Original Message-----
> From: erlends at fairplay.no [mailto:erlends at fairplay.no]
> Sent: Monday, April 05, 1999 7:23 PM
> To: dgd at list.imaginary.com
> Subject: Re: [DGD]parse_string
>
>
> Thanks for giving this detailed overview of your verb system.
>
> So, your OBJA is basically a more intelligent STR rule?


Kind of, but not really.  Let's say for the "look" verb I have a single rule
that is "OBJA" and I type "look at the twenty-first green ball".  "at the
twenty-first green ball" is going to be passed to the "OBJA" rule parser.
What I will get back will be an array that is arranged according to the
following:

	({ ({ Adjectives }), Noun, Object Index })

So, for the above, I would get:

	({ ({ "green", }), "ball", 21 })

OBJA == a mixed array with the information describing the object; the object
doesn't actually need to exist.  So, if instead of the "OBJA" token I had a
"OBJ" token, I would actually get an object that corresponds to the
twenty-first green ball (if it exists).  Does that help?


> Also, how have you handled the 'OBJ from OBJ' rule? How do you find
> the correct first OBJ?


Hence, the motivation for the OBJA token. :)  I would have restrutured the
rule to be "OBJA from OBJ" and here's why.  Let's say we have a "take" verb
with the "OBJA from OBJ" rule and I type "take the map from the drunken
clown".  So, OBJA == ({ ({ }), "map", 1, }) and OBJ == (object) clown.  I
would call the can_take_obja_from_obj function in the "take" verb with those
2 values as passed-in parameters.  Because I don't really know if the map
exists, I could make a single call (or the equivalent thereof for different
code bases) to check to see if a map exists in the clown's inventory (I know
the clown exists because I got an object back for it).  If so, I return 1
(the do_ function will called next).  I not, return 0 and the rule fails.

I could have used the "OBJ from OBJ" rule because the OBJ token (in my
system, at least) evaluates to an object in my immediate environment,
anywhere in my inventory, or anywhere in the inventory of something in my
immediate environment.  It's a costly token to use as it would take quit a
bit of searching if the map was inside a bag that was inside a backpack that
the clown was carrying.  I would have still worked, though.

Did that answer your question?

JC


List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list