ruff 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +3 -1
- data/docs/Ruff.html +3 -3
- data/docs/Ruff/Effect.html +2 -2
- data/docs/Ruff/Handler.html +2 -2
- data/docs/Ruff/Standard.html +3 -3
- data/docs/Ruff/Standard/Async.html +24 -23
- data/docs/Ruff/Standard/Async/Instance.html +57 -21
- data/docs/Ruff/Standard/Call1cc.html +297 -0
- data/docs/Ruff/Standard/CurrentTime.html +2 -2
- data/docs/Ruff/Standard/CurrentTime/Instance.html +2 -2
- data/docs/Ruff/Standard/Defer.html +2 -2
- data/docs/Ruff/Standard/Defer/Instance.html +2 -2
- data/docs/Ruff/Standard/MeasureTime.html +2 -2
- data/docs/Ruff/Standard/MeasureTime/Instance.html +2 -2
- data/docs/Ruff/Standard/State.html +2 -2
- data/docs/Ruff/Standard/State/Instance.html +2 -2
- data/docs/Ruff/Throws.html +2 -2
- data/docs/Ruff/Throws/Eff.html +2 -2
- data/docs/Ruff/Throws/Resend.html +2 -2
- data/docs/_index.html +10 -3
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +2 -2
- data/docs/frames.html +1 -1
- data/docs/index.html +2 -2
- data/docs/method_list.html +55 -39
- data/docs/top-level-namespace.html +2 -2
- data/lib/ruff/standard.rb +1 -0
- data/lib/ruff/standard/async.rb +18 -16
- data/lib/ruff/standard/call1cc.rb +57 -0
- data/lib/ruff/version.rb +1 -1
- data/version +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec108da7f3d3fa47a0e408b0a4fe5f97396668633addec0d3ca4d34c9aff35d2
|
4
|
+
data.tar.gz: 96342bb0a7372eca77bb3cd4dd4ac75fc597176f67e0bf51b329c8a11685031d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f81e02e55b423051a51bc099edd61724b8447909476a547934a4f4fda526123d1a6e28d6b329f4fcd99a8cc0c9db0340567d3870367cbf1cd6b0761fb4fbda56
|
7
|
+
data.tar.gz: 4526356c34e1bc3d490e3304b53947a0770acea53f181411221ead10fbaf0aad493d621cc8f410ffb3f32092563eb1963df54aa26caad6b6856d8a11472f2bca
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruff (1.
|
4
|
+
ruff (1.4.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -9,6 +9,7 @@ GEM
|
|
9
9
|
ast (2.4.0)
|
10
10
|
backport (1.1.2)
|
11
11
|
htmlentities (4.3.4)
|
12
|
+
irb (1.0.0)
|
12
13
|
jaro_winkler (1.5.3)
|
13
14
|
mini_portile2 (2.4.0)
|
14
15
|
nokogiri (1.10.4)
|
@@ -51,6 +52,7 @@ PLATFORMS
|
|
51
52
|
|
52
53
|
DEPENDENCIES
|
53
54
|
bundler (~> 2.0)
|
55
|
+
irb (~> 1.0)
|
54
56
|
rake (~> 10.0)
|
55
57
|
redcarpet
|
56
58
|
rubocop
|
data/docs/Ruff.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Ruff
|
8
8
|
|
9
|
-
— Ruff 1.3.
|
9
|
+
— Ruff 1.3.1 Documentation
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -109,7 +109,7 @@
|
|
109
109
|
<dt id="VERSION-constant" class="">VERSION =
|
110
110
|
|
111
111
|
</dt>
|
112
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.3.
|
112
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.3.1</span><span class='tstring_end'>'</span></span></pre></dd>
|
113
113
|
|
114
114
|
</dl>
|
115
115
|
|
@@ -301,7 +301,7 @@
|
|
301
301
|
</div>
|
302
302
|
|
303
303
|
<div id="footer">
|
304
|
-
Generated on
|
304
|
+
Generated on Wed Oct 30 01:51:52 2019 by
|
305
305
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
306
306
|
0.9.20 (ruby-2.6.5).
|
307
307
|
</div>
|
data/docs/Ruff/Effect.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Ruff::Effect
|
8
8
|
|
9
|
-
— Ruff 1.3.
|
9
|
+
— Ruff 1.3.1 Documentation
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -404,7 +404,7 @@
|
|
404
404
|
</div>
|
405
405
|
|
406
406
|
<div id="footer">
|
407
|
-
Generated on
|
407
|
+
Generated on Wed Oct 30 01:51:52 2019 by
|
408
408
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
409
409
|
0.9.20 (ruby-2.6.5).
|
410
410
|
</div>
|
data/docs/Ruff/Handler.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Ruff::Handler
|
8
8
|
|
9
|
-
— Ruff 1.3.
|
9
|
+
— Ruff 1.3.1 Documentation
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -623,7 +623,7 @@ in effect handlers of the handler.</p>
|
|
623
623
|
</div>
|
624
624
|
|
625
625
|
<div id="footer">
|
626
|
-
Generated on
|
626
|
+
Generated on Wed Oct 30 01:51:52 2019 by
|
627
627
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
628
628
|
0.9.20 (ruby-2.6.5).
|
629
629
|
</div>
|
data/docs/Ruff/Standard.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Ruff::Standard
|
8
8
|
|
9
|
-
— Ruff 1.3.
|
9
|
+
— Ruff 1.3.1 Documentation
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -117,7 +117,7 @@ Each module provides <code>Instance</code> class to instantiate and handle the i
|
|
117
117
|
<p class="children">
|
118
118
|
|
119
119
|
|
120
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Standard/Async.html" title="Ruff::Standard::Async (module)">Async</a></span>, <span class='object_link'><a href="Standard/CurrentTime.html" title="Ruff::Standard::CurrentTime (module)">CurrentTime</a></span>, <span class='object_link'><a href="Standard/Defer.html" title="Ruff::Standard::Defer (module)">Defer</a></span>, <span class='object_link'><a href="Standard/MeasureTime.html" title="Ruff::Standard::MeasureTime (module)">MeasureTime</a></span>, <span class='object_link'><a href="Standard/State.html" title="Ruff::Standard::State (module)">State</a></span>
|
120
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Standard/Async.html" title="Ruff::Standard::Async (module)">Async</a></span>, <span class='object_link'><a href="Standard/Call1cc.html" title="Ruff::Standard::Call1cc (module)">Call1cc</a></span>, <span class='object_link'><a href="Standard/CurrentTime.html" title="Ruff::Standard::CurrentTime (module)">CurrentTime</a></span>, <span class='object_link'><a href="Standard/Defer.html" title="Ruff::Standard::Defer (module)">Defer</a></span>, <span class='object_link'><a href="Standard/MeasureTime.html" title="Ruff::Standard::MeasureTime (module)">MeasureTime</a></span>, <span class='object_link'><a href="Standard/State.html" title="Ruff::Standard::State (module)">State</a></span>
|
121
121
|
|
122
122
|
|
123
123
|
|
@@ -135,7 +135,7 @@ Each module provides <code>Instance</code> class to instantiate and handle the i
|
|
135
135
|
</div>
|
136
136
|
|
137
137
|
<div id="footer">
|
138
|
-
Generated on
|
138
|
+
Generated on Wed Oct 30 01:51:52 2019 by
|
139
139
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
140
140
|
0.9.20 (ruby-2.6.5).
|
141
141
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Ruff::Standard::Async
|
8
8
|
|
9
|
-
— Ruff 1.3.
|
9
|
+
— Ruff 1.3.1 Documentation
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -85,7 +85,8 @@
|
|
85
85
|
|
86
86
|
<h2>Overview</h2><div class="docstring">
|
87
87
|
<div class="discussion">
|
88
|
-
<p><code>Async</code> provides effects <code>Async.async</code>, <code>Async.yield</code> and <code>Async.await</code>,
|
88
|
+
<p><code>Async</code> provides effects <code>Async.async</code>, <code>Async.yield</code> and <code>Async.await</code>,
|
89
|
+
and the implementation async/await.
|
89
90
|
This implementation is based on the tutorial for Multicore OCaml.
|
90
91
|
The module has an instance of <code>Instance</code> and provides its methods as module method.</p>
|
91
92
|
|
@@ -325,12 +326,12 @@ The module has an instance of <code>Instance</code> and provides its methods as
|
|
325
326
|
<pre class="lines">
|
326
327
|
|
327
328
|
|
328
|
-
|
329
|
-
|
330
|
-
|
329
|
+
178
|
330
|
+
179
|
331
|
+
180</pre>
|
331
332
|
</td>
|
332
333
|
<td>
|
333
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
334
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 178</span>
|
334
335
|
|
335
336
|
<span class='kw'>def</span> <span class='id identifier rubyid_eff'>eff</span>
|
336
337
|
<span class='ivar'>@eff</span>
|
@@ -378,12 +379,12 @@ The module has an instance of <code>Instance</code> and provides its methods as
|
|
378
379
|
<pre class="lines">
|
379
380
|
|
380
381
|
|
381
|
-
|
382
|
-
|
383
|
-
|
382
|
+
156
|
383
|
+
157
|
384
|
+
158</pre>
|
384
385
|
</td>
|
385
386
|
<td>
|
386
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
387
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 156</span>
|
387
388
|
|
388
389
|
<span class='kw'>def</span> <span class='id identifier rubyid_async'>async</span><span class='lparen'>(</span><span class='id identifier rubyid_asynth'>asynth</span><span class='rparen'>)</span>
|
389
390
|
<span class='ivar'>@inst</span><span class='period'>.</span><span class='id identifier rubyid_async'>async</span> <span class='id identifier rubyid_asynth'>asynth</span>
|
@@ -424,12 +425,12 @@ The module has an instance of <code>Instance</code> and provides its methods as
|
|
424
425
|
<pre class="lines">
|
425
426
|
|
426
427
|
|
427
|
-
|
428
|
-
|
429
|
-
|
428
|
+
161
|
429
|
+
162
|
430
|
+
163</pre>
|
430
431
|
</td>
|
431
432
|
<td>
|
432
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
433
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 161</span>
|
433
434
|
|
434
435
|
<span class='kw'>def</span> <span class='id identifier rubyid_await'>await</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='rparen'>)</span>
|
435
436
|
<span class='ivar'>@inst</span><span class='period'>.</span><span class='id identifier rubyid_await'>await</span> <span class='id identifier rubyid_p'>p</span>
|
@@ -470,12 +471,12 @@ The module has an instance of <code>Instance</code> and provides its methods as
|
|
470
471
|
<pre class="lines">
|
471
472
|
|
472
473
|
|
473
|
-
|
474
|
-
|
475
|
-
|
474
|
+
171
|
475
|
+
172
|
476
|
+
173</pre>
|
476
477
|
</td>
|
477
478
|
<td>
|
478
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
479
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 171</span>
|
479
480
|
|
480
481
|
<span class='kw'>def</span> <span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_th'>th</span><span class='rparen'>)</span>
|
481
482
|
<span class='ivar'>@inst</span><span class='period'>.</span><span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_th'>th</span><span class='rparen'>)</span>
|
@@ -516,12 +517,12 @@ The module has an instance of <code>Instance</code> and provides its methods as
|
|
516
517
|
<pre class="lines">
|
517
518
|
|
518
519
|
|
519
|
-
|
520
|
-
|
521
|
-
|
520
|
+
166
|
521
|
+
167
|
522
|
+
168</pre>
|
522
523
|
</td>
|
523
524
|
<td>
|
524
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
525
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 166</span>
|
525
526
|
|
526
527
|
<span class='kw'>def</span> <span class='kw'>yield</span>
|
527
528
|
<span class='ivar'>@inst</span><span class='period'>.</span><span class='id identifier rubyid_yield'>yield</span>
|
@@ -536,7 +537,7 @@ The module has an instance of <code>Instance</code> and provides its methods as
|
|
536
537
|
</div>
|
537
538
|
|
538
539
|
<div id="footer">
|
539
|
-
Generated on
|
540
|
+
Generated on Wed Oct 30 01:51:52 2019 by
|
540
541
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
541
542
|
0.9.20 (ruby-2.6.5).
|
542
543
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Ruff::Standard::Async::Instance
|
8
8
|
|
9
|
-
— Ruff 1.3.
|
9
|
+
— Ruff 1.3.1 Documentation
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -100,6 +100,42 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
|
103
|
+
|
104
|
+
<h2>
|
105
|
+
Constant Summary
|
106
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
107
|
+
</h2>
|
108
|
+
|
109
|
+
<dl class="constants">
|
110
|
+
|
111
|
+
<dt id="Waiting-constant" class="">Waiting =
|
112
|
+
<div class="docstring">
|
113
|
+
<div class="discussion">
|
114
|
+
<p>are ADT-like classes which have only getter method.
|
115
|
+
These are used internally.</p>
|
116
|
+
|
117
|
+
<p>type 'a promise =
|
118
|
+
| Waiting of ('a, unit) continuation list
|
119
|
+
| Done of 'a</p>
|
120
|
+
|
121
|
+
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
<div class="tags">
|
125
|
+
|
126
|
+
|
127
|
+
</div>
|
128
|
+
</dt>
|
129
|
+
<dd><pre class="code"><span class='const'>Util</span><span class='op'>::</span><span class='const'>ADT</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span></pre></dd>
|
130
|
+
|
131
|
+
<dt id="Done-constant" class="">Done =
|
132
|
+
|
133
|
+
</dt>
|
134
|
+
<dd><pre class="code"><span class='const'>Util</span><span class='op'>::</span><span class='const'>ADT</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span></pre></dd>
|
135
|
+
|
136
|
+
</dl>
|
137
|
+
|
138
|
+
|
103
139
|
|
104
140
|
|
105
141
|
|
@@ -295,7 +331,6 @@
|
|
295
331
|
<pre class="lines">
|
296
332
|
|
297
333
|
|
298
|
-
54
|
299
334
|
55
|
300
335
|
56
|
301
336
|
57
|
@@ -305,10 +340,11 @@
|
|
305
340
|
61
|
306
341
|
62
|
307
342
|
63
|
308
|
-
64
|
343
|
+
64
|
344
|
+
65</pre>
|
309
345
|
</td>
|
310
346
|
<td>
|
311
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
347
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 55</span>
|
312
348
|
|
313
349
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
314
350
|
<span class='comment'># delegates effect instances.
|
@@ -359,12 +395,12 @@ with accessing <code>Async.async</code> , <code>Async.yield</code> , and <code>A
|
|
359
395
|
<pre class="lines">
|
360
396
|
|
361
397
|
|
362
|
-
103
|
363
398
|
104
|
364
|
-
105
|
399
|
+
105
|
400
|
+
106</pre>
|
365
401
|
</td>
|
366
402
|
<td>
|
367
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
403
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 104</span>
|
368
404
|
|
369
405
|
<span class='kw'>def</span> <span class='id identifier rubyid_eff'>eff</span>
|
370
406
|
<span class='ivar'>@eff</span>
|
@@ -442,12 +478,12 @@ with accessing <code>Async.async</code> , <code>Async.yield</code> , and <code>A
|
|
442
478
|
<pre class="lines">
|
443
479
|
|
444
480
|
|
445
|
-
71
|
446
481
|
72
|
447
|
-
73
|
482
|
+
73
|
483
|
+
74</pre>
|
448
484
|
</td>
|
449
485
|
<td>
|
450
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
486
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 72</span>
|
451
487
|
|
452
488
|
<span class='kw'>def</span> <span class='id identifier rubyid_async'>async</span><span class='lparen'>(</span><span class='id identifier rubyid_th'>th</span><span class='rparen'>)</span>
|
453
489
|
<span class='ivar'>@eff</span><span class='period'>.</span><span class='id identifier rubyid_async'>async</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span> <span class='id identifier rubyid_th'>th</span>
|
@@ -518,12 +554,12 @@ with accessing <code>Async.async</code> , <code>Async.yield</code> , and <code>A
|
|
518
554
|
<pre class="lines">
|
519
555
|
|
520
556
|
|
521
|
-
87
|
522
557
|
88
|
523
|
-
89
|
558
|
+
89
|
559
|
+
90</pre>
|
524
560
|
</td>
|
525
561
|
<td>
|
526
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
562
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 88</span>
|
527
563
|
|
528
564
|
<span class='kw'>def</span> <span class='id identifier rubyid_await'>await</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='rparen'>)</span>
|
529
565
|
<span class='ivar'>@eff</span><span class='period'>.</span><span class='id identifier rubyid_await'>await</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span> <span class='id identifier rubyid_p'>p</span>
|
@@ -595,15 +631,15 @@ including <code>Async.async</code> , <code>Async.yield</code> and <code>Async.aw
|
|
595
631
|
<pre class="lines">
|
596
632
|
|
597
633
|
|
598
|
-
97
|
599
634
|
98
|
600
|
-
99
|
635
|
+
99
|
636
|
+
100</pre>
|
601
637
|
</td>
|
602
638
|
<td>
|
603
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
639
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 98</span>
|
604
640
|
|
605
641
|
<span class='id identifier rubyid_define_method'>define_method</span> <span class='symbol'>:with</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>&</span><span class='id identifier rubyid_th'>th</span><span class='op'>|</span>
|
606
|
-
<span class='id identifier rubyid_fork'>fork</span><span class='lparen'>(</span><span class='const'>Util</span><span class='op'>::</span><span class='const'>Ref</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='
|
642
|
+
<span class='id identifier rubyid_fork'>fork</span><span class='lparen'>(</span><span class='const'>Util</span><span class='op'>::</span><span class='const'>Ref</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#Waiting-constant" title="Ruff::Standard::Async::Instance::Waiting (constant)">Waiting</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Ruff::Standard::Async::Instance#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_th'>th</span><span class='rparen'>)</span>
|
607
643
|
<span class='kw'>end</span></pre>
|
608
644
|
</td>
|
609
645
|
</tr>
|
@@ -652,12 +688,12 @@ including <code>Async.async</code> , <code>Async.yield</code> and <code>Async.aw
|
|
652
688
|
<pre class="lines">
|
653
689
|
|
654
690
|
|
655
|
-
78
|
656
691
|
79
|
657
|
-
80
|
692
|
+
80
|
693
|
+
81</pre>
|
658
694
|
</td>
|
659
695
|
<td>
|
660
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line
|
696
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 79</span>
|
661
697
|
|
662
698
|
<span class='kw'>def</span> <span class='kw'>yield</span>
|
663
699
|
<span class='ivar'>@eff</span><span class='period'>.</span><span class='id identifier rubyid_yield'>yield</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span>
|
@@ -672,7 +708,7 @@ including <code>Async.async</code> , <code>Async.yield</code> and <code>Async.aw
|
|
672
708
|
</div>
|
673
709
|
|
674
710
|
<div id="footer">
|
675
|
-
Generated on
|
711
|
+
Generated on Wed Oct 30 01:51:52 2019 by
|
676
712
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
677
713
|
0.9.20 (ruby-2.6.5).
|
678
714
|
</div>
|
@@ -0,0 +1,297 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: Ruff::Standard::Call1cc
|
8
|
+
|
9
|
+
— Ruff 1.3.1 Documentation
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Ruff::Standard::Call1cc";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (C)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Ruff.html" title="Ruff (module)">Ruff</a></span></span> » <span class='title'><span class='object_link'><a href="../Standard.html" title="Ruff::Standard (module)">Standard</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Call1cc</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: Ruff::Standard::Call1cc
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/ruff/standard/call1cc.rb</dd>
|
82
|
+
</dl>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<h2>Overview</h2><div class="docstring">
|
87
|
+
<div class="discussion">
|
88
|
+
<p><code>Call1cc</code> provides call-with-oneshot-continuation.
|
89
|
+
The continuation can be run in the <code>context</code>.</p>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
<div class="tags">
|
95
|
+
|
96
|
+
<div class="examples">
|
97
|
+
<p class="tag_title">Examples:</p>
|
98
|
+
|
99
|
+
|
100
|
+
<pre class="example code"><code><span class='const'>Call1cc</span><span class='period'>.</span><span class='id identifier rubyid_context'><span class='object_link'><a href="#context-class_method" title="Ruff::Standard::Call1cc.context (method)">context</a></span></span> <span class='kw'>do</span>
|
101
|
+
<span class='id identifier rubyid_divfail'>divfail</span> <span class='op'>=</span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='comma'>,</span> <span class='id identifier rubyid_default'>default</span><span class='op'>|</span>
|
102
|
+
<span class='const'>Call1cc</span><span class='period'>.</span><span class='id identifier rubyid_run'><span class='object_link'><a href="#run-class_method" title="Ruff::Standard::Call1cc.run (method)">run</a></span></span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span>
|
103
|
+
<span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span>
|
104
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
|
105
|
+
<span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_default'>default</span><span class='rparen'>)</span>
|
106
|
+
<span class='kw'>else</span>
|
107
|
+
<span class='id identifier rubyid_e'>e</span> <span class='op'>/</span> <span class='int'>2</span>
|
108
|
+
<span class='kw'>end</span>
|
109
|
+
<span class='rbrace'>}</span>
|
110
|
+
<span class='rbrace'>}</span>
|
111
|
+
<span class='rbrace'>}</span>
|
112
|
+
|
113
|
+
<span class='id identifier rubyid_pp'>pp</span> <span class='id identifier rubyid_divfail'>divfail</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>3</span><span class='comma'>,</span> <span class='int'>5</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
114
|
+
<span class='comment'># ==> [0, 1, 2]
|
115
|
+
</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>---</span><span class='tstring_end'>'</span></span>
|
116
|
+
<span class='id identifier rubyid_pp'>pp</span> <span class='id identifier rubyid_divfail'>divfail</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>5</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
117
|
+
<span class='comment'># ==> [1]
|
118
|
+
</span><span class='kw'>end</span></code></pre>
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<h2>
|
132
|
+
Class Method Summary
|
133
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
134
|
+
</h2>
|
135
|
+
|
136
|
+
<ul class="summary">
|
137
|
+
|
138
|
+
<li class="public ">
|
139
|
+
<span class="summary_signature">
|
140
|
+
|
141
|
+
<a href="#context-class_method" title="context (class method)">.<strong>context</strong>(&prc) ⇒ Object </a>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
</span>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
156
|
+
|
157
|
+
</li>
|
158
|
+
|
159
|
+
|
160
|
+
<li class="public ">
|
161
|
+
<span class="summary_signature">
|
162
|
+
|
163
|
+
<a href="#run-class_method" title="run (class method)">.<strong>run</strong>(&f) ⇒ Object </a>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</span>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
178
|
+
|
179
|
+
</li>
|
180
|
+
|
181
|
+
|
182
|
+
</ul>
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<div id="class_method_details" class="method_details_list">
|
188
|
+
<h2>Class Method Details</h2>
|
189
|
+
|
190
|
+
|
191
|
+
<div class="method_details first">
|
192
|
+
<h3 class="signature first" id="context-class_method">
|
193
|
+
|
194
|
+
.<strong>context</strong>(&prc) ⇒ <tt>Object</tt>
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</h3><table class="source_code">
|
201
|
+
<tr>
|
202
|
+
<td>
|
203
|
+
<pre class="lines">
|
204
|
+
|
205
|
+
|
206
|
+
31
|
207
|
+
32
|
208
|
+
33
|
209
|
+
34
|
210
|
+
35
|
211
|
+
36
|
212
|
+
37
|
213
|
+
38
|
214
|
+
39
|
215
|
+
40
|
216
|
+
41
|
217
|
+
42
|
218
|
+
43</pre>
|
219
|
+
</td>
|
220
|
+
<td>
|
221
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/call1cc.rb', line 31</span>
|
222
|
+
|
223
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_context'>context</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_prc'>prc</span><span class='rparen'>)</span>
|
224
|
+
<span class='id identifier rubyid_p'>p</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'><span class='object_link'><a href="../../Ruff.html#instance-class_method" title="Ruff.instance (method)">instance</a></span></span>
|
225
|
+
<span class='ivar'>@stack</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_p'>p</span>
|
226
|
+
|
227
|
+
<span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='period'>.</span><span class='id identifier rubyid_handler'><span class='object_link'><a href="../../Ruff.html#handler-class_method" title="Ruff.handler (method)">handler</a></span></span>
|
228
|
+
<span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
229
|
+
<span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span>
|
230
|
+
<span class='kw'>end</span>
|
231
|
+
<span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_prc'>prc</span><span class='rparen'>)</span>
|
232
|
+
|
233
|
+
<span class='ivar'>@stack</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span>
|
234
|
+
<span class='id identifier rubyid_ret'>ret</span>
|
235
|
+
<span class='kw'>end</span></pre>
|
236
|
+
</td>
|
237
|
+
</tr>
|
238
|
+
</table>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
<div class="method_details ">
|
242
|
+
<h3 class="signature " id="run-class_method">
|
243
|
+
|
244
|
+
.<strong>run</strong>(&f) ⇒ <tt>Object</tt>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</h3><table class="source_code">
|
251
|
+
<tr>
|
252
|
+
<td>
|
253
|
+
<pre class="lines">
|
254
|
+
|
255
|
+
|
256
|
+
45
|
257
|
+
46
|
258
|
+
47
|
259
|
+
48
|
260
|
+
49
|
261
|
+
50
|
262
|
+
51
|
263
|
+
52
|
264
|
+
53
|
265
|
+
54</pre>
|
266
|
+
</td>
|
267
|
+
<td>
|
268
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/standard/call1cc.rb', line 45</span>
|
269
|
+
|
270
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_f'>f</span><span class='rparen'>)</span>
|
271
|
+
<span class='id identifier rubyid_top'>top</span> <span class='op'>=</span> <span class='ivar'>@stack</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
272
|
+
<span class='const'><span class='object_link'><a href="../../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='period'>.</span><span class='id identifier rubyid_handler'><span class='object_link'><a href="../../Ruff.html#handler-class_method" title="Ruff.handler (method)">handler</a></span></span>
|
273
|
+
<span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_top'>top</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
274
|
+
<span class='comment'># abort the rest of computation from calling the continuation
|
275
|
+
</span> <span class='id identifier rubyid_top'>top</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span>
|
276
|
+
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span> <span class='kw'>do</span>
|
277
|
+
<span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_top'>top</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
278
|
+
<span class='kw'>end</span>
|
279
|
+
<span class='kw'>end</span></pre>
|
280
|
+
</td>
|
281
|
+
</tr>
|
282
|
+
</table>
|
283
|
+
</div>
|
284
|
+
|
285
|
+
</div>
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
<div id="footer">
|
290
|
+
Generated on Wed Oct 30 01:51:52 2019 by
|
291
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
292
|
+
0.9.20 (ruby-2.6.5).
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</div>
|
296
|
+
</body>
|
297
|
+
</html>
|