On Fri, 24 Apr 1998, James Turner wrote: > > >As for added flexibility -- what added flexibility is gained from: > > > > > >#define GET_AC(ch) ((ch)->points.armor) > > > > > >None. > > > > The fact you don't have to remember exactly where in the structure that > > variable is. It will also leave all your code unchanged if you restructure > > the char_data structure. Typing it out has disadvantages. > > No advantages over > > int > getAC(CHAR_DATA *ch) > { > return ch->points.armor; > } IMO, that is just plain silly. Things like this are what macros were designed for. There is no reason to involve a bunch of function overhead when all you want is a shortcut for typing something longer or harder to remember. If you _are_ planning to do something more complicated or are doing something which you want to make expandable (as you later suggested), then I agree that a function may be called for. +------------------------------------------------------------+ | 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