/
index.html
380 lines (287 loc) · 12.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!DOCTYPE html>
<html>
<head>
<title>Appendix A - Glossary - Rubinius</title>
<meta content='text/html;charset=utf-8' http-equiv='content-type'>
<meta content='ja' http-equiv='content-language'>
<meta content='Rubinius is an implementation of the Ruby programming language. The Rubinius bytecode virtual machine is written in C++. The bytecode compiler is written in pure Ruby. The vast majority of the core library is also written in Ruby, with some supporting primitives that interact with the VM directly.' name='description'>
<meta content='Less Than Three. <3. http://less.thanthree.com' name='author'>
<link href='/' rel='home'>
<link href='/' rel='start'>
<link href='/doc/ja/how-to/translate-documentation' rel='prev' title='How-To - Translate Documentation'>
<link href='/doc/ja/appendix-b-reading-list' rel='next' title='Appendix B - Reading List'>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script><![endif]-->
<script src="/javascripts/jquery-1.3.2.js" type="text/javascript"></script>
<script src="/javascripts/paging_keys.js" type="text/javascript"></script>
<script src="/javascripts/application.js" type="text/javascript"></script>
<style>article, aside, dialog, figure, footer, header, hgroup, menu, nav, section { display: block; }</style>
<link href="/stylesheets/blueprint/screen.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/stylesheets/blueprint/print.css" media="print" rel="stylesheet" type="text/css" />
<!--[if IE]><link href="/stylesheets/blueprint/ie.css" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
<!--[if IE]><link href="/stylesheets/ie.css" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
<link href="/stylesheets/pygments.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<div class='container'>
<div class='span-21 doc_menu'>
<header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a id="blog" href="/blog/">Blog</a></li>
<li><a id="documentation" href="/doc/en/">Documentation</a></li>
<li><a href="/projects/">Projects</a></li>
<li><a href="/roadmap/">Roadmap</a></li>
<li><a href="/releases/">Releases</a></li>
</ul>
</nav>
</header>
</div>
<div class='span-3 last'>
<div id='version'>
<a href="/releases/1.2.3">1.2.3</a>
</div>
</div>
</div>
<div class="container languages">
<nav>
<span class="label">言語:</span>
<ul>
<li><a href="/doc/de/"
>de</a></li>
<li><a href="/doc/en/"
>en</a></li>
<li><a href="/doc/es/"
>es</a></li>
<li><a href="/doc/ja/"
class="current"
>ja</a></li>
<li><a href="/doc/pl/"
>pl</a></li>
<li><a href="/doc/ru/"
>ru</a></li>
</ul>
</nav>
</div>
<div class="container doc_page_nav">
<span class="label">Previous:</span>
<a href="/doc/ja/how-to/translate-documentation">How-To - Translate Documentation</a>
<span class="label">Up:</span>
<a href="/doc/ja/">目次</a>
<span class="label">Next:</span>
<a href="/doc/ja/appendix-b-reading-list">Appendix B - Reading List</a>
</div>
<div class="container documentation">
<h2>Appendix A - Glossary</h2>
<div class="review">
<p>This page was machine translated. Please help us improve it.</p>
<p>See <a href="/doc/ja/how-to/translate-documentation">
How-To - Translate Documentation</a></p>
</div>
<div class="review">
<p>This topic has missing or partial documentation. Please help us improve
it.</p>
<p>See <a href="/doc/ja/how-to/write-documentation">
How-To - Write Documentation</a></p>
</div>
<p>Definitions of terms and phrases used in the Ruby programming language and in
this implementation. See also “The Ruby Programming Language” by Flanagan and
Matsumoto [O’Reilly 2008] and “Programming Ruby: The Pragmatic Programmer’s
Guide” 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
2005-2008]</p>
<ul>
<li>
<p><em>method lookup or method resolution</em></p>
<p>The rule is simple: Take the object located in the class slot of the object
(which is not always the return value of Object#class; if the object has one,
it’ll be the singleton class) and begin searching.</p>
<p>Searching goes up the superclass chain until the superclass is nil.</p>
<p>In which case, redo lookup for method_missing. If we fail to find
method_missing, fail tragically.</p>
<pre><code> +----------------+
| nil |
+----------------+
^
| superclass
|
+----------------+
| Object |
+----------------+
^
| superclass
|
+----------------+
| Module |
+----------------+
^
| superclass
|
+----------------+
| Class |
+----------------+
^
| superclass
|
+----------------+
| SingletonClass |
| (Object) |
+----------------+
^
| superclass
|
+-------------+ +----------------+
| F | -----------------> | SingletonClass |
+-------------+ singleton class | (F) |
+----------------+
class Class
def wanker
puts 'you are'
end
end
class F
def self.bloke
wanker
end
end
</code></pre>
<ol>
<li>
<p>Resolve method ‘wanker’ – search method_tables in:</p>
<ol>
<li>SingletonClass(F)</li>
<li>SingletonClass(Object)</li>
<li>Class</li>
</ol>
</li>
</ol>
<p>Found</p>
</li>
<li>
<p><em>method_table</em></p>
<p>A data structure in every class (and module) that contains the methods defined
for that class.</p>
<p>In Rubinius, a class’s method_table is an instance of LookupTable.</p>
</li>
<li>
<p><em>MatzRuby</em></p>
<p>See MRI</p>
</li>
<li>
<p><em>MRI</em></p>
<p>Matz’s Ruby Interpreter or Matz’s Ruby Implementation. A short name to refer
to the official implementation of Ruby. See <a href="http://ruby-lang.org">http://ruby-lang.org</a>.</p>
</li>
<li>
<p><em>private send</em></p>
<p>A method call that has no explicit lexical receiver. The receiver of the
call is +self+. For example:</p>
<pre><code>class A
private
def you_are_mine
end
end
class B < A
def sunshine
you_are_mine
end
end
class C
def dear
today = B.new
today.you_are_mine
end
end
</code></pre>
<p>The call to +you_are_mine+ in the method +sunshine+ is a private send. The
call to +today.you_are_mine+ will not succeed because private methods cannot
have an explicit receiver. In this case, the object +today+ is the explicit
receiver.</p>
</li>
<li>
<p><em>singleton class</em></p>
<p>Every object in Ruby can have one, although they are only created as
necessary. The singleton class holds the method and constant tables that
belong only to a particular object instance. For example, the method
+hello+ defined below exists only in the singleton class for +obj+.</p>
<pre><code>obj = Object.new
def obj.hello
puts 'hi'
end
</code></pre>
<p>Since all classes in Ruby are also objects, they can have singleton classes.
The methods called “class methods” are just methods in the method_table of
the class’s singleton class. The method +honk+ exists in the singleton class
for the class +Car+.</p>
<pre><code>class Car
def self.honk
end
end
</code></pre>
<p>In Rubinius, singleton classes are all instances of the class
SingletonClass. The singleton class for an object can be obtained by calling
the +singleton_class+ method. The overall arrangement of concepts involved
here is sometimes referred to as the ‘Meta-Object Protocol’ or +MOP+.</p>
</li>
<li>
<p><em>superclass</em></p>
<p>The class that a particular class immediately inherits from. The class Object
is the superclass of all classes that do not inherit explicitly from a class.</p>
<pre><code>class A
end
class B < A
end
</code></pre>
<p>Class A inherits from Object. In other words, A.superclass == Object. Class B
inherits explicitly from class A. So, B.superclass == A.</p>
</li>
</ul>
</div>
<div class="container doc_page_nav">
<span class="label">Previous:</span>
<a href="/doc/ja/how-to/translate-documentation">How-To - Translate Documentation</a>
<span class="label">Up:</span>
<a href="/doc/ja/">目次</a>
<span class="label">Next:</span>
<a href="/doc/ja/appendix-b-reading-list">Appendix B - Reading List</a>
</div>
<div class="container">
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'rubinius';
var disqus_identifier = '/doc/ja/appendix-a-glossary/';
var disqus_url = 'http://rubini.us/doc/ja/appendix-a-glossary/';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
<footer>
<div class='container'>
<nav>
<ul>
<li><a href="http://twitter.com/rubinius">Follow Rubinius on Twitter</a></li>
<li><a href="http://github.com/evanphx/rubinius">Fork Rubinius on github</a></li>
<li><a href="http://engineyard.com">An Engine Yard project</a></li>
<li id='credit'>
Site design by
<a href="http://less.thanthree.com">Less Than Three</a>
</li>
</ul>
</nav>
</div>
</footer>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12328521-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>