Removing an old, cherished, yet pointless caveat "This documentation is
[supercollider.git] / Help / Core / Nil.html
blob7779ff2c002dad9d6be678b5c70d2588541e7579
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="1038.29">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
14 p.p5 {margin: 0.0px 0.0px 0.0px 42.0px; font: 12.0px Helvetica}
15 p.p6 {margin: 0.0px 0.0px 0.0px 42.0px; font: 12.0px Helvetica; min-height: 14.0px}
16 span.s1 {color: #1032ee}
17 span.s2 {text-decoration: underline}
18 span.Apple-tab-span {white-space:pre}
19 </style>
20 </head>
21 <body>
22 <p class="p1"><b>Nil</b></p>
23 <p class="p2"><br></p>
24 <p class="p3"><b>Inherits from: </b><a href="Object.html"><span class="s1"><b>Object</b></span></a><b><span class="Apple-converted-space"> </span></b></p>
25 <p class="p2"><br></p>
26 <p class="p3">Nil has a single instance named nil and is used to represent uninitialized data,</p>
27 <p class="p3">bad values, or terminal values such as end-of-stream.</p>
28 <p class="p2"><br></p>
29 <p class="p4"><b>Instance Methods</b></p>
30 <p class="p2"><br></p>
31 <p class="p5"><b>isNil</b></p>
32 <p class="p5"><span class="Apple-tab-span"> </span>Answers true because this <span class="s2">is</span> nil. In class Object this message is defined to answer false.</p>
33 <p class="p6"><br></p>
34 <p class="p5"><b>notNil</b></p>
35 <p class="p5"><span class="Apple-tab-span"> </span>Answer false. In class Object this message answers true.</p>
36 <p class="p6"><br></p>
37 <p class="p5"><b>? anObject</b></p>
38 <p class="p5"><span class="Apple-tab-span"> </span>? means return first non-nil argument. Since this IS nil then return anObject.</p>
39 <p class="p5"><span class="Apple-tab-span"> </span>In class Object, ? is defined to answer the receiver.</p>
40 <p class="p6"><br></p>
41 <p class="p5"><b>?? aFunction</b></p>
42 <p class="p5">If the receiver is nil, value the function and return the result.<span class="Apple-converted-space">  </span>Since this IS nil, then value the function and return the result. In class Object, ?? is defined to answer the receiver.</p>
43 <p class="p6"><br></p>
44 <p class="p5"><b>add(value)</b></p>
45 <p class="p5">Returns an array with the <b>value</b>. This makes it unecessary to initialize when adding to a variable.</p>
46 <p class="p6"><br></p>
47 <p class="p5"><b>addAll(array)</b></p>
48 <p class="p5">Returns an array with all the values. This makes it unecessary to initialize when adding to a variable.</p>
49 <p class="p6"><br></p>
50 <p class="p5"><b>remove</b></p>
51 <p class="p5">Returns nil. This makes it unecessary to initialize when adding to a variable.</p>
52 <p class="p6"><br></p>
53 <p class="p5"><b>++ array</b></p>
54 <p class="p5">Returns an array with all the values. This makes it unecessary to initialize when adding to a variable.</p>
55 <p class="p2"><br></p>
56 <p class="p4"><b>Dependancy</b></p>
57 <p class="p2"><br></p>
58 <p class="p3">All the messages for the Dependancy protocol (See class Object) are defined in class Nil<span class="Apple-converted-space"> </span></p>
59 <p class="p3">to do nothing. This eliminates the need to check for nil when sending dependancy messages.</p>
60 <p class="p2"><br></p>
61 <p class="p4"><b>Other Methods</b></p>
62 <p class="p2"><br></p>
63 <p class="p3">Many other messages are defined in class Nil to do nothing. This eliminates the need to check for nil.</p>
64 <p class="p2"><br></p>
65 <p class="p2"><br></p>
66 </body>
67 </html>