Debian Codegraph @

docsrc/xlisp/xlisp-doc/reference/keyword-show.htm

raw
1 <html><head><title>XLISP :show</title>
2
3 <link rel="stylesheet" type="text/css" href="reference.css">
4
5 </head>
6
7 <body>
8
9 <a href="../start.htm">Nyquist / XLISP 2.0</a>&nbsp; -&nbsp;
10 <a href="../manual/contents.htm">Contents</a> |
11 <a href="../tutorials/tutorials.htm">Tutorials</a> |
12 <a href="../examples/examples.htm">Examples</a> |
13 <a href="reference-index.htm">Reference</a>
14
15 <hr>
16
17 <h1>:show</h1>
18
19 <hr>
20
21 <p><table cellpadding="0" cellspacing="0" style="margin-left:10px"><tbody>
22 <tr valign="top">
23 <td><nobr>Type:</nobr></td>
24 <td><nobr>&nbsp;&nbsp;-&nbsp;&nbsp;</nobr></td>
25 <td width="100%"><nobr>message selector</nobr></td>
26 </tr>
27 <tr valign="top">
28 <td><nobr>Source:</nobr></td>
29 <td><nobr>&nbsp;&nbsp;-&nbsp;&nbsp;</nobr></td>
30 <td width="100%"><nobr>xlobj.c</nobr></td>
31 </tr>
32 </tbody></table></p>
33
34 <h2>Syntax</h2>
35
36 <dl>
37 <dt>(send <i>object</i> :show)</dt>
38 <dd><i>object</i> - an existing <a href="object.htm">object</a><br>
39 returns - the <i>object</i></dd>
40 </dl>
41
42 <h2>Description</h2>
43
44 <p>The ':show' message selector attempts to find the 'show' method in the
45 specified <a href="object.htm">object</a>s class. Since the ':show'
46 message selector is built-in in the root
47 <a href="class.htm">class</a>, this is always a valid message
48 selector. The <a href="object.htm">object</a> must already
49 exist.</p>
50
51 <h2>Examples</h2>
52
53 <pre class="example">
54 (setq my-class (send class :new '(state))) <font color="#008844">; create MY-CLASS with STATE</font>
55
56 (send my-class :answer :isnew '() <font color="#008844">; set up initialization</font>
57 '((setq state nil) self))
58
59 (send my-class :answer :set-it '(value) <font color="#008844">; create :SET-IT message</font>
60 '((setq state value)))
61
62 (setq my-obj (send my-class :new)) <font color="#008844">; create MY-OBJ of MY-CLASS</font>
63 (send my-obj :show) <font color="#008844">; returns object state including STATE = NIL</font>
64 (send my-obj :set-it 5) <font color="#008844">; STATE is set to 5</font>
65 (send new-obj :show) <font color="#008844">; error: unbound variable</font>
66 </pre>
67
68 <p>See the
69 <a href="../manual/xlisp-man-010.htm#object-show">:show</a>
70 message selector in the <nobr>XLISP 2.0</nobr> manual.</p>
71
72 <p><nobr>&nbsp;&nbsp;<a href="#top">Back to Top</nobr></a></p>
73
74 <hr>
75
76 <a href="../start.htm">Nyquist / XLISP 2.0</a>&nbsp; -&nbsp;
77 <a href="../manual/contents.htm">Contents</a> |
78 <a href="../tutorials/tutorials.htm">Tutorials</a> |
79 <a href="../examples/examples.htm">Examples</a> |
80 <a href="reference-index.htm">Reference</a>
81
82 </body></html>