Re: Circlemud design issues

From: George (greerga@CIRCLEMUD.ORG)
Date: 04/24/98


On Fri, 24 Apr 1998, James Turner wrote:

>skip_spaces would work fine.  Personally I don't like skip spaces
>much; it's ugly code.  Heh, it is one of the few functions that would
>look better as a macro ;) (the isspace would ensure type safety).
>Skip spaces would work just as well though.  Doesn't much matter
>either way.
>
>#define skip_spaces(s) while(*(s) && isspace(*s)) (s)++

void skip_spaces(char **string)
{
  for (; **string && isspace(**string); (*string)++);
}

Could become:
  while (**string && isspace(**string)) (*string)++;

I suppose it's that way because it is a basic string function and
inheritance.  Having a str_cpy() macro wouldn't make sense for instance.
Although the ones that do do a lot are generally error checking wrappers
(create), generic (remove_from_list), or just forced inline (can_see).

I think some MUD bases just do that code in every function instead of a
separate function.

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | 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