source: project/release/2/dissector/dissector.html @ 8742

Last change on this file since 8742 was 8742, checked in by felix winkelmann, 12 years ago

moved eggs partially to rrb2

File size: 13.4 KB
Line 
1<html>
2  <head>
3    <title>dissector</title>
4    <meta http-equiv="Content-type"
5          contents="text/html; charset=iso-8859-1">
6    <style type="text/css">
7      <!--
8          body {
9            padding-left:  3.5%;
10            padding-right: 3.5%;
11          }
12
13          h2 {
14            font-family: monospace;
15          }
16
17          em {
18            font-weight: bold;
19            font-style: normal;
20          }
21
22          dl.command-listing {
23            padding-left:  3.5%;
24            padding-right: 3.5%;
25          }
26
27          dt.function { 
28            background: #f5f5f5;
29            color: black;
30            padding: 0.1em;
31            border: 1px solid #bbbaaf;
32            font-family: monospace;
33          }
34
35          dt.command {
36            font-family: monospace;
37          }
38
39          div.alias-list {
40            padding-left: 5%;
41          }
42        -->
43    </style>
44  </head>
45  <body>
46
47<center><img src="egg.jpg"></center>
48<center><a href="index.html">back</a></center>
49
50    <h2>dissector</h2>
51
52  <h3>Requirements:</h3>
53
54  <a href="syntax-case.html">syntax-case</a>
55
56    <h3>Description:</h3>
57    <p>An object inspector for Chicken.</p>
58
59    <h3>Author:</h3>
60    <p>Taylor Campbell</p>
61
62    <p>
63      Send questions, comments, bugs, et cetera to Taylor Campbell,
64      either via email at
65
66<tt>&#99;</tt><tt>&#97;</tt><tt>&#109;</tt><tt>&#112;</tt><tt>&#98;</tt><tt>&#101;</tt><tt>&#108;</tt><tt>&#108;</tt><tt>&#32;</tt><tt>&#40;</tt><tt>&#97;</tt><tt>&#116;</tt><tt>&#41;</tt><tt>&#32;</tt><tt>&#109;</tt><tt>&#117;</tt><tt>&#109;</tt><tt>&#98;</tt><tt>&#108;</tt><tt>&#101;</tt><tt>&#32;</tt><tt>&#40;</tt><tt>&#100;</tt><tt>&#111;</tt><tt>&#116;</tt><tt>&#41;</tt><tt>&#32;</tt><tt>&#110;</tt><tt>&#101;</tt><tt>&#116;</tt>
67
68      or via IRC in <tt>#scheme</tt> or in <tt>#chicken</tt> on
69      Freenode (<tt>irc.freenode.net</tt>).
70
71    <h3>Version:</h3>
72    <ul>
73    <li>1.7.4
74    Fixed several bugs reported by Andre Kuehne
75    <li>1.7.3
76    Removed incorrect redefintion of <code>fold</code>[Reed Sheridan]
77    </li>
78    <li>1.7.2
79    Renamed <code>tagged-pointer?</code> which shadowed a primitive function [Thanks to
80    Reed Sheridan]
81    <li>1.7.1
82Replaced use of <code>(end-of-file)</code> with <code>#!eof</code>
83    <li>1.7
84    </ul>
85
86    <h3>Usage:</h3>
87    <code>(require-extension dissector)</code>
88
89    <h3>Download:</h3>
90    <p><a href="http://www.call-with-current-continuation.org/eggs/dissector.egg">dissector.egg</a></p>
91
92    <h3>Documentation:</h3>
93
94    <p>
95      The dissector is an interactive object structure inspector.  It
96      allows for expedient inspection of a tree of objects' components.
97      It consists of a current 'focus object' &mdash; the object
98      currently being dissected &mdash;, a menu of that object's
99      components, and an interactive command reader for commands that
100      the user uses to interactively browse the objects.
101    </p>
102
103<dl>
104  <dt class="function"><em>(procedure)</em> (dissect <i>object</i> [<i>inport</i> [<i>outport</i>]])
105  <dd>
106    <tt>Dissect</tt> invokes the dissector.  If given,
107    <tt><i>inport</i></tt> & <tt><i>outport</i></tt> specify the ports
108    to &amp; from which commands & output are read & written.
109  </dd>
110</dl>
111
112    <p>
113      Dissector commands are put each on single lines.  The first part
114      of the line should be a symbol.  The remainder of the line
115      consists of arguments to the command.  After certain commands, a
116      summary of the focus object may be printed.  This summary is
117      truncated to fit within your terminal.  (Actually, it's truncated
118      to fit within 72 lines.  But that's usually enough for most
119      terminals.  And this doesn't necessarily apply if using a custom
120      printer.)  Other commands may print a selection from the menu of
121      an object's components.  In this selection is printed summaries
122      of a number of an object's components.  Each component is given
123      a particular index; this index may be used to select the
124      respective subcomponent of the focus object.  A list of dissector
125      commands and help for them can be acquired with the <tt>help</tt>
126      command, or the <tt>?</tt> alias for it.
127    </p>
128
129    <p>
130      There are several parameter objects that affect the dissector's
131      operation.
132    </p>
133
134<dl>
135  <dt class="function"><em>(parameter)</em> dissection-prompt -&gt; string</dt>
136  <dd><p>
137    This specifies the prompt to be printed before waiting for the user
138    to send a command.
139  </p></dd>
140
141  <dt class="function"><em>(parameter)</em> dissection-menu-section-size -&gt; exact, positive integer</dt>
142  <dd><p>
143    This specifies the maximum number of entries to be printed when
144    disclosing a section of a menu to the user.
145  </p></dd>
146
147  <dt class="function"><em>(parameter)</em> dissection-overview-printer -&gt; procedure</dt>
148  <dd><p>
149    The function to print a dissection's overview.  The function takes
150    two arguments: the object to print and the port to print it to.
151  </p></dd>
152
153  <dt class="function"><em>(parameter)</em> dissection-menu-entry-printer -&gt; procedure</dt>
154  <dd><p>
155    The function to print a dissected object's components.  It takes
156    three arguments: the object to print, the number of characters
157    already printed to the port on the current line, and the port to
158    print the object to.
159  </p></dd>
160
161  <dt class="function"><em>(parameter)</em> dissection-right-margin -&gt; exact, positive integer</dt>
162  <dd><p>
163    The right margin for printing objects.  This is merely a hint to
164    the <tt>dissection-...-printer</tt> parameters.  Its default is 71,
165    to fit nearly all terminals.
166  </p></dd>
167</dl>
168
169<p>
170Supported dissector commands:
171</p>
172<dl class="command-listing">
173   <dt class="command">apply&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(a)</dt>
174   <dd>Apply a function to the focus object.</dd>
175
176   <dt class="command">apply/dissect&nbsp;&nbsp;&nbsp;(ad)</dt>
177   <dd>Apply a function to the focus object & dissect its result.</dd>
178
179   <dt class="command">dissect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(d)</dt>
180   <dd>Dissect a completely new object.</dd>
181
182   <dt class="command">eval&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(e scheme)</dt>
183   <dd>Evaluate an expression.</dd>
184
185   <dt class="command">help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(?)</dt>
186   <dd>Print help for commands.</dd>
187
188   <dt class="command">history&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(h)</dt>
189   <dd>Print the dissection history.</dd>
190
191   <dt class="command">menu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(m)</dt>
192   <dd>Print just the current menu.</dd>
193
194   <dt class="command">overview&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(o)</dt>
195   <dd>Print the focus value, without a menu.</dd>
196
197   <dt class="command">print&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(p)</dt>
198   <dd>Print out the entirety of the current dissection.</dd>
199
200   <dt class="command">quit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(q exit)</dt>
201   <dd>Quit the dissection.</dd>
202
203   <dt class="command">select&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(s)</dt>
204   <dd>Select a component of the focus object to dissect.</dd>
205
206   <dt class="command">up&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(u)</dt>
207   <dd>Move back up the history of dissected objects.</dd>
208
209   <dt class="command">walk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(w)</dt>
210   <dd>Walk about in the current menu.</dd>
211</dl>
212
213<dl>
214  <dt class="function"><em>(command)</em> apply <i>expression</i></dt>
215  <dd><div class="alias-list">alias: <tt>a</tt></div><p>
216    Evaluates <tt><i>expression</i></tt> in the interaction
217    environment, which should produce a unary function, and applies it
218    to the current focus object.  This does not modify the current
219    dissection.
220  </p></dd>
221
222  <dt class="function"><em>(command)</em> apply/dissect <i>expression</i></dt>
223  <dd><div class="alias-list">alias: <tt>ad</tt></div><p>
224    Evaluates <tt><i>expression</i></tt> in the interaction
225    environment, which should produce a unary function, and applies it
226    to the current focus object.  It must return at least one value.
227    If it returns one value, that value is dissected; if it returns
228    more than one, a list containing the values is dissected.
229  </p></dd>
230
231  <dt class="function"><em>(command)</em> dissect <i>expression</i></dt>
232  <dd><div class="alias-list">alias: <tt>d</tt></div><p>
233    Evaluates <tt><i>expression</i></tt> in the interaction environment
234    and dissects the value that is produced.
235    <tt><i>Expression</i></tt> may evaluate to one or more values.
236    With one value, that value is dissected; with more, a list of the
237    values is dissected.
238  </p></dd>
239
240  <dt class="function"><em>(command)</em> eval <i>expression</i></dt>
241  <dd><div class="alias-list">aliases: <tt>e scheme</tt></div><p>
242    Evalutes <tt><i>expression</i></tt> in the interaction environment
243    and prints the results.  This does not modify the current
244    dissection.
245  </p></dd>
246
247  <dt class="function"><em>(command)</em> help [<i>command</i>]</dt>
248  <dd><div class="alias-list">alias: <tt>?</tt></div><p>
249    If <tt><i>command</i></tt> is absent, prints out a brief help
250    synopsis for every supported command; otherwise prints out help for
251    <tt><i>command</i></tt>.
252  </p></dd>
253
254  <dt class="function"><em>(command)</em> history</dt>
255  <dd><div class="alias-list">alias: <tt>h</tt></div><p>
256    Prints the dissection history.
257  </p></dd>
258
259  <dt class="function"><em>(command)</em> menu</dt>
260  <dd><div class="alias-list">alias: <tt>m</tt></div><p>
261    Prints just the current menu.
262  </p></dd>
263
264  <dt class="function"><em>(command)</em> overview</dt>
265  <dd><div class="alias-list">alias: <tt>o</tt></div><p>
266    Prints the focus value, without a menu.
267  </p></dd>
268
269  <dt class="function"><em>(command)</em> print</dt>
270  <dd><div class="alias-list">alias: <tt>p</tt></div><p>
271    Prints out the entirety of the current dissection.
272  </p></dd>
273
274  <dt class="function"><em>(command)</em> quit</dt>
275  <dd><div class="alias-list">aliases: <tt>q exit</tt></div><p>
276    Quits the dissector.
277  </p></dd>
278
279  <dt class="function"><em>(command)</em> select <i>index</i> [<i>deep-index</i> ...]</dt>
280  <dd><div class="alias-list">alias: <tt>s</tt></div><p>
281    Selects the <tt><i>index</i></tt><super>th</super> slot in the
282    focus object to dissect next.  <tt><i>Index</i></tt> must be a
283    valid index into the focus object, as shown by the menu.  If
284    more than one index is passed, it is as if the select command were
285    applied multiple times, to each successive index.
286  </p></dd>
287
288  <dt class="function"><em>(command)</em> up [<i>count</i>]</dt>
289  <dd><div class="alias-list">alias: <tt>u</tt></div><p>
290    Moves <tt><i>count</i></tt> elements back up the history of
291    dissected objects.  If <tt><i>count</i></tt> is absent, it defaults
292    to 1.
293  </p></dd>
294
295  <dt class="function"><em>(command)</em> walk [<i>slot-count</i>]</dt>
296  <dd><div class="alias-list">alias: <tt>w</tt></div><p>
297    Moves the current menu selection by <tt><i>slot-count</i></tt>
298    elements.  If <tt><i>slot-count</i></tt> is negative, the menu is
299    moved backwards; if it's positive, it is moved forwards.  If it is
300    absent, the menu is moved forward by
301    <tt>(dissection-menu-section-size)</tt> slots.
302  </p></dd>
303</dl>
304
305    <h3>Licence:</h3>
306
307    <blockquote>
308      <p>
309        Copyright (C) 2004, Taylor Campbell<br>
310        All rights reserved.
311      </p>
312
313      <p>
314        Redistribution and use in source and binary forms, with or
315        without modification, are permitted provided that the following
316        conditions are met:
317      </p>
318
319      <ul>
320        <li>
321          Redistributions of source code must retain the above
322          copyright notice, this list of conditions and the following
323          disclaimer.
324        </li>
325        <li>
326          Redistributions in binary form must reproduce the above
327          copyright notice, this list of conditions and the following
328          disclaimer in the documentation and/or other materials
329          provided with the distribution.
330        </li>
331        <li>
332          The name of the author may not be used to endorse or promote
333          products derived from this software without specific prior
334          written permission.
335        </li>
336      </ul>
337
338      <p>
339        Modifications are requested, but not required, to be sent to
340        the author in source code  form, along with any accompanying
341        new or modified documentation.
342      </p>
343
344      <p>
345        THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
346        EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
347        THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
348        PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
349        AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
350        EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
351        TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352        DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
353        ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
354        LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
355        IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
356        THE POSSIBILITY OF SUCH DAMAGE.
357    </blockquote>
358
359<hr><a href="index.html">back</a>
360
361  </body>
362</html>
Note: See TracBrowser for help on using the repository browser.