This wiki article contains incomplete and informal notes about the MPS, the precursor to more formal documentation. Not confidential. Readership: MPS users and developers.
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∅.
2007-04-26 RHSK Created; in brief.
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:
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.