This wiki article contains incomplete and informal notes about the MPS, the precursor to more formal documentation. Not confidential. Readership: MPS users and developers.

Briefly...

The Describe methods print out a datastructure for a human programmer to read. Often they need to use the class hierarchy and inheritance (see design/protocol for more on this). Here are some examples of how it works:

ArenaDescribe [arena.c] outputs generic stuff,
 then calls down to the bottom: (*arena->class->describe)(arena, stream);
 which then calls upwards...
 (except that no arena classes override the topmost Triv method yet)


PoolDescribe [pool.c] outputs generic stuff,
 then calls down to the bottom: (*pool->class->describe)(pool, stream);
 which then calls upwards...
 (except that AMCDescribe doesn't, and AMSDescribe doesn't, 
  presumably because they 'know' that the next method is 
  PoolTrivDescribe which would say "No class-specific description 
  available")


SegDescribe [seg.c] outputs generic stuff,
 then calls down to the bottom: seg->class->describe(seg, stream);
 which then calls upwards:
  eg. in AMCSegDescribe [poolamc.c]:
     /* Describe the superclass fields first via next-method call */
     super = SEG_SUPERCLASS(amcSegClass);
     res = super->describe(seg, stream);


I see it now: the "SegDescribe" etc is like the generic function.  
But instead of merely doing the dispatching, and leaving all output 
to the appropriate class-hierarchy methods, it 'makes a start' by 
outputting the generic fields.  I'm not sure this is quite the nicest, 
but that's how we do it at the moment.

Here's a typical result of a single call to SegDescribe:

    Segment 03FD9480 [037D4000,037D5000) {
      class 0005D298 ("AMCSEG")
      pool 03FFE278 (7)
      shield depth 1
      protection mode:
      shield mode: read write
      ranks: exact
      white  00000000000000000000000000000001
      grey   00000000000000000000000000000001
      nailed 00000000000000000000000000000001
      buffer: NULL
      summary 00008400
    AMC seg 03FD9480 [037D4000,037D5000){
      Boarded
      Map
        037D4000  *=============*========*========*================*=========*====
        037D4100  ======*=========*==*=============*==============*=========*=====
        037D4200  =======*===*===========*==============*============*============
        037D4300  =*============*==============*===================*===========*==
        037D4400  ===*===============*==============*===================*=========
        037D4500  ==*===============*======*========*===========*==============*==
        037D4600  ===============*=============*===============*================*=
        037D4700  ====*==========*============*===============*===================
        037D4800  *=================*===========*===*============*==============*=
        037D4900  ========*=====*==============*=============*====================
        037D4A00  *========*===============*=======*===========*==========*=======
        037D4B00  ==========*========*==================*============*============
        037D4C00  ==*===============*===================*==================*======
        037D4D00  ======*==========*==============*=======*===============*=======
        037D4E00  ========*=========*============*============*===*=====*=========
        037D4F00  ====*=*=*========*====*===============*==============*===*=*====
    } AMC Seg 03FD9480

    } Segment 03FD9480

This article taken from email: http://info.ravenbrook.com/mail/2007/04/25/17-03-21/0.txt.

B. Document History

  2007-04-26  RHSK  Created; in brief.

C. Copyright and License

This document is copyright © 2007 Ravenbrook Limited. All rights reserved. This is an open source license. Contact Ravenbrook for commercial licensing options.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Redistributions in any form must be accompanied by information on how to obtain complete source code for the this software and any accompanying software that uses this software. The source code must either be included in the distribution or be available for no more than the cost of distribution plus a nominal fee, and must be freely redistributable under reasonable conditions. For an executable file, complete source code means the source code for all modules it contains. It does not include source code for modules or files that typically accompany the major components of the operating system on which the executable file runs.

This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement, are disclaimed. In no event shall the copyright holders and contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.