Re: coding.doc (no, wait!)

From: Jared Buckley (jaredb@TI.COM)
Date: 09/11/97


George wrote:
>[snip-good coding doc extracted...]
> +
> +       To actually let people access the command, we need to modify the
> +master command list found at about line 196 of interpreter.c.  This is the
> +structure searched everytime someone types a command.  Commands are
> +searched in such a way that if you were to put 'lookie' above 'look' in
> +the chart, you could never get to 'look' because the interpreter would
> +always find 'lookie' first because it is an abbreviation of 'look'

Looks great.  I might clarify the section above.  Specifically when
you are reading down the page of code then saying that putting
'lookie' _above_ 'look' is correct, however if you're talking about
its relative position in the array, then "above" is exactly where
you want to put it!  Rather than just be a whiner, here's how I might
rewrite it:

To actually let people access the command, we need to modify the
master command list found at about line 196 of interpreter.c.  This
array of struct command_info, contains information about every
command available in Circle.  The order of commands in this array
is significant.  Because Circle allows you to abbreviate commands,
and because the array is searched in ascending order ( from "RESERVED"
to "zreset" ) it is important to order your commands so that
an abbreviation doesn't prevent another command from being accessed.
For instance, placing the command 'lookie' into the array before
the command 'look' guarantees that the 'look' command can never be
accessed.  This is because 'look' will be interpreted as an
abbreviation for 'lookie'.

Just my 2 cents.

Jared


     +------------------------------------------------------------+
     | 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/08/00 PST