Re: [IDEA] External argument parser

From: d. hall (dhall@OOI.NET)
Date: 08/26/98


>>>>>> thus on Wed, 26 Aug 1998 19:52:48 +0300, Andrey wrote:

> I want to suggest a new type of command argument parser for CircleMUD.
> Instead of passing full argument to ACMD and then converting it to few
> strings and processing it with get_char_vis, get_obj_vis etc we can parse
> all arguments before calling ACMD, and pass only pointers to prepared
> linked lists to it.  This way, most ACMD functions will become a lot
> smaller and easier to understand and even some parsing bugs will
> disappear.

This is an interesting suggestion.  One of the main problems with this is
that Circle 3.0 in beta mode is attempting stability(?).  A sweeping change
that would require all the ACMD's to be rewritten would probably be slated
for Circle 4.0 (or if we're emulating a Redmond company, Circle 3.5 =).

The main reason why ACMD is generic is that it's like a callback function
in a signal handler.  All the function are typecast as the same type so
that the interpreter can assign the function to handle the command.  One of
the ways I can see to implement your method while keeping the same system
of callbacks is to use varargs for ACMD.

d.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST