code-ruby 3.1.2 → 4.0.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.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/bin/code +97 -20
  4. data/lib/code/concerns/shared.rb +331 -15
  5. data/lib/code/format.rb +15 -1
  6. data/lib/code/network.rb +87 -0
  7. data/lib/code/node/call.rb +79 -2
  8. data/lib/code/node/call_argument.rb +14 -0
  9. data/lib/code/node/code.rb +5 -4
  10. data/lib/code/node/function_parameter.rb +7 -4
  11. data/lib/code/node/list.rb +29 -1
  12. data/lib/code/object/base_64.rb +132 -6
  13. data/lib/code/object/boolean.rb +60 -0
  14. data/lib/code/object/class.rb +138 -2
  15. data/lib/code/object/code.rb +111 -3
  16. data/lib/code/object/context.rb +57 -1
  17. data/lib/code/object/cryptography.rb +63 -0
  18. data/lib/code/object/date.rb +13339 -462
  19. data/lib/code/object/decimal.rb +1725 -0
  20. data/lib/code/object/dictionary.rb +1790 -11
  21. data/lib/code/object/duration.rb +28 -0
  22. data/lib/code/object/function.rb +261 -23
  23. data/lib/code/object/global.rb +534 -1
  24. data/lib/code/object/html.rb +179 -7
  25. data/lib/code/object/http.rb +244 -14
  26. data/lib/code/object/ics.rb +75 -13
  27. data/lib/code/object/identifier_list.rb +17 -2
  28. data/lib/code/object/integer.rb +1937 -2
  29. data/lib/code/object/json.rb +75 -1
  30. data/lib/code/object/list.rb +3383 -10
  31. data/lib/code/object/nothing.rb +53 -0
  32. data/lib/code/object/number.rb +110 -0
  33. data/lib/code/object/parameter.rb +140 -0
  34. data/lib/code/object/range.rb +576 -14
  35. data/lib/code/object/smtp.rb +95 -12
  36. data/lib/code/object/string.rb +944 -3
  37. data/lib/code/object/super.rb +10 -1
  38. data/lib/code/object/time.rb +13358 -498
  39. data/lib/code/object/url.rb +65 -0
  40. data/lib/code/object.rb +543 -0
  41. data/lib/code/parser.rb +161 -24
  42. data/lib/code-ruby.rb +3 -0
  43. data/lib/code.rb +30 -3
  44. metadata +135 -84
  45. data/.github/dependabot.yml +0 -15
  46. data/.github/workflows/ci.yml +0 -38
  47. data/.gitignore +0 -30
  48. data/.node-version +0 -1
  49. data/.npm-version +0 -1
  50. data/.prettierignore +0 -2
  51. data/.rspec +0 -1
  52. data/.rubocop.yml +0 -140
  53. data/.ruby-version +0 -1
  54. data/.tool-versions +0 -3
  55. data/AGENTS.md +0 -43
  56. data/Gemfile +0 -22
  57. data/Gemfile.lock +0 -292
  58. data/Rakefile +0 -5
  59. data/bin/bundle +0 -123
  60. data/bin/bundle-audit +0 -31
  61. data/bin/bundler-audit +0 -31
  62. data/bin/dorian +0 -31
  63. data/bin/rspec +0 -31
  64. data/bin/rubocop +0 -31
  65. data/bin/test +0 -5
  66. data/code-ruby.gemspec +0 -34
  67. data/docs/precedence.txt +0 -36
  68. data/package-lock.json +0 -14
  69. data/package.json +0 -7
  70. data/spec/bin/code_spec.rb +0 -48
  71. data/spec/code/format_spec.rb +0 -153
  72. data/spec/code/node/call_spec.rb +0 -11
  73. data/spec/code/object/boolean_spec.rb +0 -18
  74. data/spec/code/object/cryptography_spec.rb +0 -25
  75. data/spec/code/object/decimal_spec.rb +0 -50
  76. data/spec/code/object/dictionary_spec.rb +0 -98
  77. data/spec/code/object/function_spec.rb +0 -268
  78. data/spec/code/object/http_spec.rb +0 -33
  79. data/spec/code/object/ics_spec.rb +0 -50
  80. data/spec/code/object/integer_spec.rb +0 -42
  81. data/spec/code/object/list_spec.rb +0 -22
  82. data/spec/code/object/nothing_spec.rb +0 -14
  83. data/spec/code/object/range_spec.rb +0 -23
  84. data/spec/code/object/string_spec.rb +0 -26
  85. data/spec/code/parser/boolean_spec.rb +0 -11
  86. data/spec/code/parser/chained_call_spec.rb +0 -16
  87. data/spec/code/parser/dictionary_spec.rb +0 -18
  88. data/spec/code/parser/function_spec.rb +0 -16
  89. data/spec/code/parser/group_spec.rb +0 -11
  90. data/spec/code/parser/if_modifier_spec.rb +0 -18
  91. data/spec/code/parser/list_spec.rb +0 -17
  92. data/spec/code/parser/number_spec.rb +0 -11
  93. data/spec/code/parser/string_spec.rb +0 -20
  94. data/spec/code/parser_spec.rb +0 -52
  95. data/spec/code/type_spec.rb +0 -21
  96. data/spec/code_spec.rb +0 -717
  97. data/spec/spec_helper.rb +0 -21
  98. data/spec/zeitwerk/loader_spec.rb +0 -7
@@ -3,6 +3,2596 @@
3
3
  class Code
4
4
  class Object
5
5
  class List < Object
6
+ CLASS_DOCUMENTATION = {
7
+ name: "List",
8
+ description: "stores ordered values and provides enumerable operations.",
9
+ examples: [
10
+ "[1, 2, 3]",
11
+ "[1, 2, 3].map((value) => { value * 2 })",
12
+ "List.new([1, 2])"
13
+ ]
14
+ }.freeze
15
+ INSTANCE_FUNCTIONS = {
16
+ "[]" => {
17
+ name: "[]",
18
+ description: "returns the item at an index.",
19
+ examples: ["[1, 2, 3][0]", "[1, 2, 3][1]", "[:a, :b][0]"]
20
+ },
21
+ "at" => {
22
+ name: "at",
23
+ description: "returns the item at an index.",
24
+ examples: ["[1, 2, 3].at(0)", "[1, 2, 3].at(1)", "[:a, :b].at(0)"]
25
+ },
26
+ "get" => {
27
+ name: "get",
28
+ description: "returns the item at an index.",
29
+ examples: ["[1, 2, 3].get(0)", "[1, 2, 3].get(1)", "[:a, :b].get(0)"]
30
+ },
31
+ "fetch" => {
32
+ name: "fetch",
33
+ description: "returns the item at an index or nothing when missing.",
34
+ examples: [
35
+ "[1, 2, 3].fetch(0)",
36
+ "[1, 2, 3].fetch(2)",
37
+ "[1].fetch(2)"
38
+ ]
39
+ },
40
+ "values_at" => {
41
+ name: "values_at",
42
+ description: "returns items at multiple indexes.",
43
+ examples: [
44
+ "[1, 2, 3].values_at(0, 2)",
45
+ "[:a, :b, :c].values_at(1, 2)",
46
+ "[1, 2, 3].values_at(0)"
47
+ ]
48
+ },
49
+ "slice" => {
50
+ name: "slice",
51
+ description: "returns a slice from the list.",
52
+ examples: [
53
+ "[1, 2, 3].slice(0)",
54
+ "[1, 2, 3].slice(0, 2)",
55
+ "[:a, :b, :c].slice(1, 2)"
56
+ ]
57
+ },
58
+ "slice!" => {
59
+ name: "slice!",
60
+ description: "removes and returns a slice from the list.",
61
+ examples: [
62
+ "[1, 2, 3].slice!(0)",
63
+ "[1, 2, 3].slice!(0, 2)",
64
+ "[:a, :b, :c].slice!(1, 2)"
65
+ ]
66
+ },
67
+ "clear" => {
68
+ name: "clear",
69
+ description: "removes every item from the list and returns it.",
70
+ examples: ["[1, 2, 3].clear", "[].clear", "[:a].clear"]
71
+ },
72
+ "join" => {
73
+ name: "join",
74
+ description: "returns a string made by joining list items.",
75
+ examples: [
76
+ "[1, 2, 3].join",
77
+ "[1, 2, 3].join(\",\")",
78
+ "[:a, :b].join(\"-\")"
79
+ ]
80
+ },
81
+ "sort" => {
82
+ name: "sort",
83
+ description: "returns a new list sorted by item values or function results.",
84
+ examples: [
85
+ "[3, 1, 2].sort",
86
+ "[:b, :a].sort",
87
+ "[3, 1, 2].sort((x) => { x })"
88
+ ]
89
+ },
90
+ "sort!" => {
91
+ name: "sort!",
92
+ description: "sorts the list in place by item values or function results.",
93
+ examples: [
94
+ "[3, 1, 2].sort!",
95
+ "[:b, :a].sort!",
96
+ "[3, 1, 2].sort!((x) => { x })"
97
+ ]
98
+ },
99
+ "<<" => {
100
+ name: "<<",
101
+ description: "appends an item to the list and returns it.",
102
+ examples: ["[1, 2] << 3", "[] << :a", "[:a] << :b"]
103
+ },
104
+ "append" => {
105
+ name: "append",
106
+ description: "appends an item to the list and returns it.",
107
+ examples: [
108
+ "[1, 2].append(3)",
109
+ "[].append(:a)",
110
+ "[:a].append(:b)"
111
+ ]
112
+ },
113
+ "push" => {
114
+ name: "push",
115
+ description: "appends an item to the list and returns it.",
116
+ examples: ["[1, 2].push(3)", "[].push(:a)", "[:a].push(:b)"]
117
+ },
118
+ "prepend" => {
119
+ name: "prepend",
120
+ description: "prepends an item to the list and returns it.",
121
+ examples: [
122
+ "[2, 3].prepend(1)",
123
+ "[].prepend(:a)",
124
+ "[:b].prepend(:a)"
125
+ ]
126
+ },
127
+ "insert" => {
128
+ name: "insert",
129
+ description: "inserts an item at an index and returns the list.",
130
+ examples: [
131
+ "[1, 3].insert(1, 2)",
132
+ "[:b].insert(0, :a)",
133
+ "[1, 2].insert(2, 3)"
134
+ ]
135
+ },
136
+ "concat" => {
137
+ name: "concat",
138
+ description: "appends lists to the list and returns it.",
139
+ examples: [
140
+ "[1].concat([2])",
141
+ "[1].concat([2], [3])",
142
+ "[].concat([:a])"
143
+ ]
144
+ },
145
+ "fill" => {
146
+ name: "fill",
147
+ description: "replaces list items with a value and returns the list.",
148
+ examples: [
149
+ "[1, 2, 3].fill(0)",
150
+ "[1, 2, 3].fill(0, 1)",
151
+ "[1, 2, 3].fill(0, 1, 2)"
152
+ ]
153
+ },
154
+ "+" => {
155
+ name: "+",
156
+ description: "returns a new list with another list appended.",
157
+ examples: ["[1] + [2]", "[] + [:a]", "[1, 2] + [3]"]
158
+ },
159
+ "plus" => {
160
+ name: "plus",
161
+ description: "returns a new list with another list appended.",
162
+ examples: [
163
+ "[1].plus([2])",
164
+ "[].plus([:a])",
165
+ "[1, 2].plus([3])"
166
+ ]
167
+ },
168
+ "-" => {
169
+ name: "-",
170
+ description: "returns a new list without items from another list.",
171
+ examples: ["[1, 2] - [2]", "[:a, :b] - [:a]", "[1, 2] - []"]
172
+ },
173
+ "minus" => {
174
+ name: "minus",
175
+ description: "returns a new list without items from another list.",
176
+ examples: [
177
+ "[1, 2].minus([2])",
178
+ "[:a, :b].minus([:a])",
179
+ "[1, 2].minus([])"
180
+ ]
181
+ },
182
+ "any?" => {
183
+ name: "any?",
184
+ description: "returns whether any item is present or matches a function or class.",
185
+ examples: [
186
+ "[1, 2, 3].any?",
187
+ "[1, 2, 3].any?((x) => { x > 2 })",
188
+ "[].any?"
189
+ ]
190
+ },
191
+ "detect" => {
192
+ name: "detect",
193
+ description: "returns the first item matched by a function or class.",
194
+ examples: [
195
+ "[1, 2, 3].detect((x) => { x > 1 })",
196
+ "[1, 2, 3].detect(Integer)",
197
+ "[1, 2, 3].detect((x) => { x > 3 })"
198
+ ]
199
+ },
200
+ "index" => {
201
+ name: "index",
202
+ description: "returns the index of an item or first item matched by a function or class.",
203
+ examples: [
204
+ "[:a, :b].index(:b)",
205
+ "[1, 2, 3].index((x) => { x > 1 })",
206
+ "[:a].index(:missing)"
207
+ ]
208
+ },
209
+ "find_index" => {
210
+ name: "find_index",
211
+ description: "returns the index of an item or first item matched by a function or class.",
212
+ examples: [
213
+ "[:a, :b].find_index(:b)",
214
+ "[1, 2, 3].find_index((x) => { x > 1 })",
215
+ "[:a].find_index(:missing)"
216
+ ]
217
+ },
218
+ "right_index" => {
219
+ name: "right_index",
220
+ description: "returns the last index of an item or of an item matched by a function or class.",
221
+ examples: [
222
+ "[:a, :b, :a].right_index(:a)",
223
+ "[1, 2, 3].right_index((x) => { x > 1 })",
224
+ "[:a].right_index(:missing)"
225
+ ]
226
+ },
227
+ "each" => {
228
+ name: "each",
229
+ description: "calls a function or class for each item and returns the list.",
230
+ examples: [
231
+ "[1, 2, 3].each((x) => { x })",
232
+ "[:a, :b].each((x) => { x })",
233
+ "[].each((x) => { x })"
234
+ ]
235
+ },
236
+ "each_index" => {
237
+ name: "each_index",
238
+ description: "calls a function for each item index and returns the list.",
239
+ examples: [
240
+ "[1, 2, 3].each_index((i) => { i })",
241
+ "[:a, :b].each_index((i) => { i })",
242
+ "[].each_index((i) => { i })"
243
+ ]
244
+ },
245
+ "first" => {
246
+ name: "first",
247
+ description: "returns the first item or first items.",
248
+ examples: ["[1, 2, 3].first", "[1, 2, 3].first(2)", "[].first"]
249
+ },
250
+ "second" => {
251
+ name: "second",
252
+ description: "returns the second item.",
253
+ examples: ["[1, 2, 3].second", "[:a, :b].second", "[1].second"]
254
+ },
255
+ "third" => {
256
+ name: "third",
257
+ description: "returns the third item.",
258
+ examples: ["[1, 2, 3].third", "[:a, :b, :c].third", "[1].third"]
259
+ },
260
+ "fourth" => {
261
+ name: "fourth",
262
+ description: "returns the fourth item.",
263
+ examples: ["[1, 2, 3, 4].fourth", "(1..5).to_list.fourth", "[1].fourth"]
264
+ },
265
+ "fifth" => {
266
+ name: "fifth",
267
+ description: "returns the fifth item.",
268
+ examples: ["[1, 2, 3, 4, 5].fifth", "(1..6).to_list.fifth", "[1].fifth"]
269
+ },
270
+ "sixth" => {
271
+ name: "sixth",
272
+ description: "returns the sixth item.",
273
+ examples: ["(1..6).to_list.sixth", "(1..7).to_list.sixth", "[1].sixth"]
274
+ },
275
+ "seventh" => {
276
+ name: "seventh",
277
+ description: "returns the seventh item.",
278
+ examples: [
279
+ "(1..7).to_list.seventh",
280
+ "(1..8).to_list.seventh",
281
+ "[1].seventh"
282
+ ]
283
+ },
284
+ "eighth" => {
285
+ name: "eighth",
286
+ description: "returns the eighth item.",
287
+ examples: [
288
+ "(1..8).to_list.eighth",
289
+ "(1..9).to_list.eighth",
290
+ "[1].eighth"
291
+ ]
292
+ },
293
+ "ninth" => {
294
+ name: "ninth",
295
+ description: "returns the ninth item.",
296
+ examples: [
297
+ "(1..9).to_list.ninth",
298
+ "(1..10).to_list.ninth",
299
+ "[1].ninth"
300
+ ]
301
+ },
302
+ "tenth" => {
303
+ name: "tenth",
304
+ description: "returns the tenth item.",
305
+ examples: [
306
+ "(1..10).to_list.tenth",
307
+ "(1..11).to_list.tenth",
308
+ "[1].tenth"
309
+ ]
310
+ },
311
+ "map" => {
312
+ name: "map",
313
+ description: "returns a new list with each item transformed by a function or class.",
314
+ examples: [
315
+ "[1, 2, 3].map(Integer)",
316
+ "[:1, :2].map(Integer)",
317
+ "[1, 2].map((value) => { value + 1 })"
318
+ ]
319
+ },
320
+ "sample" => {
321
+ name: "sample",
322
+ description: "returns a random item or random items from the list.",
323
+ examples: ["[1, 2, 3].sample", "[1, 2, 3].sample(2)", "[:a].sample"]
324
+ },
325
+ "shuffle" => {
326
+ name: "shuffle",
327
+ description: "returns a new list with items shuffled.",
328
+ examples: ["[1, 2, 3].shuffle", "[:a, :b].shuffle", "[].shuffle"]
329
+ },
330
+ "shuffle!" => {
331
+ name: "shuffle!",
332
+ description: "shuffles the list in place and returns it.",
333
+ examples: ["[1, 2, 3].shuffle!", "[:a, :b].shuffle!", "[].shuffle!"]
334
+ },
335
+ "flatten" => {
336
+ name: "flatten",
337
+ description: "returns a new list with nested lists flattened.",
338
+ examples: [
339
+ "[1, [2, 3]].flatten",
340
+ "[[1], [2]].flatten",
341
+ "[1, 2].flatten"
342
+ ]
343
+ },
344
+ "delete" => {
345
+ name: "delete",
346
+ description: "removes matching items from the list and returns the removed value.",
347
+ examples: [
348
+ "[1, 2, 2].delete(2)",
349
+ "[:a, :b].delete(:a)",
350
+ "[1].delete(2)"
351
+ ]
352
+ },
353
+ "delete_at" => {
354
+ name: "delete_at",
355
+ description: "removes and returns the item at an index.",
356
+ examples: [
357
+ "[1, 2, 3].delete_at(1)",
358
+ "[:a, :b].delete_at(0)",
359
+ "[1].delete_at(2)"
360
+ ]
361
+ },
362
+ "delete_if" => {
363
+ name: "delete_if",
364
+ description: "removes items matched by a function or class and returns the list.",
365
+ examples: [
366
+ "[1, 2, 3].delete_if((x) => { x > 1 })",
367
+ "[:a, :b].delete_if((x) => { x == :a })",
368
+ "[].delete_if((x) => { x })"
369
+ ]
370
+ },
371
+ "keep_if" => {
372
+ name: "keep_if",
373
+ description: "keeps items matched by a function or class and returns the list.",
374
+ examples: [
375
+ "[1, 2, 3].keep_if((x) => { x > 1 })",
376
+ "[:a, :b].keep_if((x) => { x == :a })",
377
+ "[].keep_if((x) => { x })"
378
+ ]
379
+ },
380
+ "pop" => {
381
+ name: "pop",
382
+ description: "returns the last item or last items without mutating the list.",
383
+ examples: ["[1, 2, 3].pop", "[1, 2, 3].pop(2)", "[].pop"]
384
+ },
385
+ "pop!" => {
386
+ name: "pop!",
387
+ description: "removes and returns the last item or last items.",
388
+ examples: ["[1, 2, 3].pop!", "[1, 2, 3].pop!(2)", "[].pop!"]
389
+ },
390
+ "shift" => {
391
+ name: "shift",
392
+ description: "removes and returns the first item or first items.",
393
+ examples: ["[1, 2, 3].shift", "[1, 2, 3].shift(2)", "[].shift"]
394
+ },
395
+ "include?" => {
396
+ name: "include?",
397
+ description: "returns whether the list includes an item.",
398
+ examples: [
399
+ "[1, 2, 3].include?(2)",
400
+ "[:a, :b].include?(:c)",
401
+ "[].include?(1)"
402
+ ]
403
+ },
404
+ "member?" => {
405
+ name: "member?",
406
+ description: "returns whether the list includes an item.",
407
+ examples: [
408
+ "[1, 2, 3].member?(2)",
409
+ "[:a, :b].member?(:c)",
410
+ "[].member?(1)"
411
+ ]
412
+ },
413
+ "last" => {
414
+ name: "last",
415
+ description: "returns the last item.",
416
+ examples: ["[1, 2, 3].last", "[:a, :b].last", "[].last"]
417
+ },
418
+ "take" => {
419
+ name: "take",
420
+ description: "returns the first items from the list.",
421
+ examples: ["[1, 2, 3].take(2)", "[1, 2, 3].take(0)", "[].take(2)"]
422
+ },
423
+ "drop" => {
424
+ name: "drop",
425
+ description: "returns the list after dropping leading items.",
426
+ examples: ["[1, 2, 3].drop(1)", "[1, 2, 3].drop(3)", "[].drop(1)"]
427
+ },
428
+ "drop_while" => {
429
+ name: "drop_while",
430
+ description: "drops leading items while a function or class matches.",
431
+ examples: [
432
+ "[1, 2, 3].drop_while((x) => { x < 3 })",
433
+ "[1, 2, 3].drop_while((x) => { x < 1 })",
434
+ "[].drop_while((x) => { x })"
435
+ ]
436
+ },
437
+ "take_while" => {
438
+ name: "take_while",
439
+ description: "takes leading items while a function or class matches.",
440
+ examples: [
441
+ "[1, 2, 3].take_while((x) => { x < 3 })",
442
+ "[1, 2, 3].take_while((x) => { x < 1 })",
443
+ "[].take_while((x) => { x })"
444
+ ]
445
+ },
446
+ "zip" => {
447
+ name: "zip",
448
+ description: "returns a list by zipping items with other lists.",
449
+ examples: [
450
+ "[1, 2].zip([3, 4])",
451
+ "[:a, :b].zip([1, 2])",
452
+ "[].zip([])"
453
+ ]
454
+ },
455
+ "map!" => {
456
+ name: "map!",
457
+ description: "transforms each item in place and returns the list.",
458
+ examples: [
459
+ "[1, 2, 3].map!((x) => { x + 1 })",
460
+ "[:1, :2].map!(Integer)",
461
+ "[].map!((x) => { x })"
462
+ ]
463
+ },
464
+ "flat_map" => {
465
+ name: "flat_map",
466
+ description: "maps each item and flattens the result one level.",
467
+ examples: [
468
+ "[1, 2].flat_map((x) => { [x, x] })",
469
+ "[[1], [2]].flat_map((x) => { x })",
470
+ "[].flat_map((x) => { [x] })"
471
+ ]
472
+ },
473
+ "max" => {
474
+ name: "max",
475
+ description: "returns the maximum item.",
476
+ examples: ["[1, 3, 2].max", "[:a, :b].max", "[].max"]
477
+ },
478
+ "maximum" => {
479
+ name: "maximum",
480
+ description: "returns the maximum item.",
481
+ examples: [
482
+ "[1, 3, 2].maximum",
483
+ "[:a, :b].maximum",
484
+ "[].maximum"
485
+ ]
486
+ },
487
+ "minimum" => {
488
+ name: "minimum",
489
+ description: "returns the minimum item.",
490
+ examples: [
491
+ "[1, 3, 2].minimum",
492
+ "[:a, :b].minimum",
493
+ "[].minimum"
494
+ ]
495
+ },
496
+ "minimum_maximum" => {
497
+ name: "minimum_maximum",
498
+ description: "returns the minimum and maximum items.",
499
+ examples: [
500
+ "[1, 3, 2].minimum_maximum",
501
+ "[:a, :b].minimum_maximum",
502
+ "[].minimum_maximum"
503
+ ]
504
+ },
505
+ "none?" => {
506
+ name: "none?",
507
+ description: "returns whether no items are present or match a function or class.",
508
+ examples: [
509
+ "[].none?",
510
+ "[1, 2, 3].none?((x) => { x > 3 })",
511
+ "[1, 2, 3].none?((x) => { x > 1 })"
512
+ ]
513
+ },
514
+ "all?" => {
515
+ name: "all?",
516
+ description: "returns whether all items are present or match a function or class.",
517
+ examples: [
518
+ "[1, 2, 3].all?",
519
+ "[1, 2, 3].all?((x) => { x > 0 })",
520
+ "[1, 2, 3].all?((x) => { x > 1 })"
521
+ ]
522
+ },
523
+ "reduce" => {
524
+ name: "reduce",
525
+ description: "combines list items with a function.",
526
+ examples: [
527
+ "[1, 2, 3].reduce((sum, x) => { sum + x })",
528
+ "[1, 2, 3].reduce((sum, x) => { sum * x })",
529
+ "[:a, :b].reduce((left, right) => { left + right })"
530
+ ]
531
+ },
532
+ "group" => {
533
+ name: "group",
534
+ description: "returns a dictionary grouping items by a function result or class match.",
535
+ examples: [
536
+ "[1, 2, 3].group((x) => { x.even? })",
537
+ "[:a, :b].group(String)",
538
+ "[].group((x) => { x })"
539
+ ]
540
+ },
541
+ "partition" => {
542
+ name: "partition",
543
+ description: "splits items into matching and non-matching lists.",
544
+ examples: [
545
+ "[1, 2, 3].partition((x) => { x > 1 })",
546
+ "[:a, :b].partition((x) => { x == :a })",
547
+ "[].partition((x) => { x })"
548
+ ]
549
+ },
550
+ "cycle" => {
551
+ name: "cycle",
552
+ description: "returns cycled items or calls a function for each cycled item.",
553
+ examples: [
554
+ "[1, 2].cycle(2)",
555
+ "[1, 2].cycle(2, (x) => { x })",
556
+ "[:a].cycle(3, (x) => { x })"
557
+ ]
558
+ },
559
+ "transpose" => {
560
+ name: "transpose",
561
+ description: "returns rows and columns swapped.",
562
+ examples: [
563
+ "[[1, 2], [3, 4]].transpose",
564
+ "[[:a, :b], [:c, :d]].transpose",
565
+ "[].transpose"
566
+ ]
567
+ },
568
+ "combination" => {
569
+ name: "combination",
570
+ description: "returns combinations of list items.",
571
+ examples: [
572
+ "[1, 2, 3].combination(2)",
573
+ "[:a, :b, :c].combination(1)",
574
+ "[].combination(2)"
575
+ ]
576
+ },
577
+ "permutation" => {
578
+ name: "permutation",
579
+ description: "returns permutations of list items.",
580
+ examples: [
581
+ "[1, 2, 3].permutation(2)",
582
+ "[:a, :b].permutation",
583
+ "[].permutation"
584
+ ]
585
+ },
586
+ "product" => {
587
+ name: "product",
588
+ description: "returns cartesian products with other lists.",
589
+ examples: [
590
+ "[1, 2].product([3, 4])",
591
+ "[:a, :b].product([1])",
592
+ "[].product([1, 2])"
593
+ ]
594
+ },
595
+ "repeated_combination" => {
596
+ name: "repeated_combination",
597
+ description: "returns repeated combinations of list items.",
598
+ examples: [
599
+ "[1, 2].repeated_combination(2)",
600
+ "[:a, :b].repeated_combination(3)",
601
+ "[].repeated_combination(2)"
602
+ ]
603
+ },
604
+ "repeated_permutation" => {
605
+ name: "repeated_permutation",
606
+ description: "returns repeated permutations of list items.",
607
+ examples: [
608
+ "[1, 2].repeated_permutation(2)",
609
+ "[:a, :b].repeated_permutation(3)",
610
+ "[].repeated_permutation(2)"
611
+ ]
612
+ },
613
+ "reverse" => {
614
+ name: "reverse",
615
+ description: "returns a new list with items in reverse order.",
616
+ examples: ["[1, 2, 3].reverse", "[:a, :b].reverse", "[].reverse"]
617
+ },
618
+ "reverse!" => {
619
+ name: "reverse!",
620
+ description: "reverses the list in place and returns it.",
621
+ examples: ["[1, 2, 3].reverse!", "[:a, :b].reverse!", "[].reverse!"]
622
+ },
623
+ "reverse_each" => {
624
+ name: "reverse_each",
625
+ description: "calls a function for each item in reverse order.",
626
+ examples: [
627
+ "[1, 2, 3].reverse_each((x) => { x })",
628
+ "[:a, :b].reverse_each((x) => { x })",
629
+ "[].reverse_each((x) => { x })"
630
+ ]
631
+ },
632
+ "rotate" => {
633
+ name: "rotate",
634
+ description: "returns a new list rotated by an offset.",
635
+ examples: [
636
+ "[1, 2, 3].rotate",
637
+ "[1, 2, 3].rotate(2)",
638
+ "[:a, :b].rotate"
639
+ ]
640
+ },
641
+ "rotate!" => {
642
+ name: "rotate!",
643
+ description: "rotates the list in place and returns it.",
644
+ examples: [
645
+ "[1, 2, 3].rotate!",
646
+ "[1, 2, 3].rotate!(2)",
647
+ "[:a, :b].rotate!"
648
+ ]
649
+ },
650
+ "union" => {
651
+ name: "union",
652
+ description: "returns a list containing unique items from each list.",
653
+ examples: [
654
+ "[1, 2].union([2, 3])",
655
+ "[:a].union([:b])",
656
+ "[].union([1])"
657
+ ]
658
+ },
659
+ "intersection" => {
660
+ name: "intersection",
661
+ description: "returns items present in every list.",
662
+ examples: [
663
+ "[1, 2].intersection([2, 3])",
664
+ "[:a, :b].intersection([:b])",
665
+ "[].intersection([1])"
666
+ ]
667
+ },
668
+ "difference" => {
669
+ name: "difference",
670
+ description: "returns items not present in another list.",
671
+ examples: [
672
+ "[1, 2].difference([2])",
673
+ "[:a, :b].difference([:a])",
674
+ "[].difference([1])"
675
+ ]
676
+ },
677
+ "intersect?" => {
678
+ name: "intersect?",
679
+ description: "returns whether the list shares items with another list.",
680
+ examples: [
681
+ "[1, 2].intersect?([2, 3])",
682
+ "[:a].intersect?([:b])",
683
+ "[].intersect?([1])"
684
+ ]
685
+ },
686
+ "associate" => {
687
+ name: "associate",
688
+ description: "returns the first nested list whose first item matches a value.",
689
+ examples: [
690
+ "[[:a, 1], [:b, 2]].associate(:a)",
691
+ "[[1, :a], [2, :b]].associate(2)",
692
+ "[[:a, 1]].associate(:missing)"
693
+ ]
694
+ },
695
+ "right_associate" => {
696
+ name: "right_associate",
697
+ description: "returns the first nested list whose second item matches a value.",
698
+ examples: [
699
+ "[[1, :a], [2, :b]].right_associate(:a)",
700
+ "[[:a, 1], [:b, 2]].right_associate(2)",
701
+ "[[:a, 1]].right_associate(:missing)"
702
+ ]
703
+ },
704
+ "select" => {
705
+ name: "select",
706
+ description: "returns items matched by a function or class.",
707
+ examples: [
708
+ "[1, 2, 3].select((x) => { x > 1 })",
709
+ "[1, :a, 2].select(Integer)",
710
+ "[].select((x) => { x })"
711
+ ]
712
+ },
713
+ "filter" => {
714
+ name: "filter",
715
+ description: "returns items matched by a function or class.",
716
+ examples: [
717
+ "[1, 2, 3].filter((x) => { x > 1 })",
718
+ "[1, :a, 2].filter(Integer)",
719
+ "[].filter((x) => { x })"
720
+ ]
721
+ },
722
+ "select!" => {
723
+ name: "select!",
724
+ description: "keeps items matched by a function or class and returns the list.",
725
+ examples: [
726
+ "[1, 2, 3].select!((x) => { x > 1 })",
727
+ "[1, :a, 2].select!(Integer)",
728
+ "[].select!((x) => { x })"
729
+ ]
730
+ },
731
+ "filter!" => {
732
+ name: "filter!",
733
+ description: "keeps items matched by a function or class and returns the list.",
734
+ examples: [
735
+ "[1, 2, 3].filter!((x) => { x > 1 })",
736
+ "[1, :a, 2].filter!(Integer)",
737
+ "[].filter!((x) => { x })"
738
+ ]
739
+ },
740
+ "compact" => {
741
+ name: "compact",
742
+ description: "returns a new list without nothing values or matched items.",
743
+ examples: [
744
+ "[1, nothing, 2].compact",
745
+ "[1, :a, 2].compact(String)",
746
+ "[1, 2, 3].compact((x) => { x > 1 })"
747
+ ]
748
+ },
749
+ "compact!" => {
750
+ name: "compact!",
751
+ description: "removes nothing values or matched items in place and returns the list.",
752
+ examples: [
753
+ "[1, nothing, 2].compact!",
754
+ "[1, :a, 2].compact!(String)",
755
+ "[1, 2, 3].compact!((x) => { x > 1 })"
756
+ ]
757
+ },
758
+ "reject" => {
759
+ name: "reject",
760
+ description: "returns items not matched by a function or class.",
761
+ examples: [
762
+ "[1, 2, 3].reject((x) => { x > 1 })",
763
+ "[1, :a, 2].reject(Integer)",
764
+ "[].reject((x) => { x })"
765
+ ]
766
+ },
767
+ "reject!" => {
768
+ name: "reject!",
769
+ description: "removes items matched by a function or class and returns the list.",
770
+ examples: [
771
+ "[1, 2, 3].reject!((x) => { x > 1 })",
772
+ "[1, :a, 2].reject!(Integer)",
773
+ "[].reject!((x) => { x })"
774
+ ]
775
+ },
776
+ "size" => {
777
+ name: "size",
778
+ description: "returns the number of items in the list.",
779
+ examples: ["[1, 2, 3].size", "[].size", "[:a].size"]
780
+ },
781
+ "length" => {
782
+ name: "length",
783
+ description: "returns the number of items in the list.",
784
+ examples: ["[1, 2, 3].length", "[].length", "[:a].length"]
785
+ },
786
+ "empty?" => {
787
+ name: "empty?",
788
+ description: "returns whether the list has no items.",
789
+ examples: ["[].empty?", "[1].empty?", "[:a, :b].empty?"]
790
+ },
791
+ "count" => {
792
+ name: "count",
793
+ description: "returns the number of items or matching items.",
794
+ examples: [
795
+ "[1, 2, 3].count",
796
+ "[1, 2, 2].count((x) => { x == 2 })",
797
+ "[1, 2, 3].count((x) => { x > 1 })"
798
+ ]
799
+ },
800
+ "sum" => {
801
+ name: "sum",
802
+ description: "returns the sum of list items.",
803
+ examples: ["[1, 2, 3].sum", "[].sum", "[10, 20].sum"]
804
+ },
805
+ "tally" => {
806
+ name: "tally",
807
+ description: "returns a dictionary counting each item.",
808
+ examples: [
809
+ "[:a, :b, :a].tally",
810
+ "[1, 1, 2].tally",
811
+ "[].tally"
812
+ ]
813
+ },
814
+ "entries" => {
815
+ name: "entries",
816
+ description: "returns the list itself.",
817
+ examples: ["[1, 2, 3].entries", "[].entries", "[:a].entries"]
818
+ },
819
+ "to_dictionary" => {
820
+ name: "to_dictionary",
821
+ description: "converts the list to a dictionary using entry pairs or indexes.",
822
+ examples: [
823
+ "[[:a, 1], [:b, 2]].to_dictionary",
824
+ "[\"a\", \"b\"].to_dictionary",
825
+ "[].to_dictionary"
826
+ ]
827
+ },
828
+ "uniq" => {
829
+ name: "uniq",
830
+ description: "returns a new list with duplicate items removed.",
831
+ examples: [
832
+ "[1, 1, 2].uniq",
833
+ "[:a, :a].uniq",
834
+ "[1, 2, 3].uniq((x) => { x > 1 })"
835
+ ]
836
+ },
837
+ "sort_by!" => {
838
+ name: "sort_by!",
839
+ description: "sorts the list in place by function results.",
840
+ examples: [
841
+ "[3, 1, 2].sort_by!((x) => { x })",
842
+ "[:bb, :a].sort_by!((x) => { x.size })",
843
+ "[].sort_by!((x) => { x })"
844
+ ]
845
+ },
846
+ "uniq!" => {
847
+ name: "uniq!",
848
+ description: "removes duplicate items in place and returns the list.",
849
+ examples: [
850
+ "[1, 1, 2].uniq!",
851
+ "[:a, :a].uniq!",
852
+ "[1, 2, 3].uniq!((x) => { x > 1 })"
853
+ ]
854
+ },
855
+ "eleventh" => {
856
+ name: "eleventh",
857
+ description: "returns the eleventh item.",
858
+ examples: [
859
+ "(1..11).to_list.eleventh",
860
+ "(1..12).to_list.eleventh",
861
+ "[].eleventh"
862
+ ]
863
+ },
864
+ "twelfth" => {
865
+ name: "twelfth",
866
+ description: "returns the twelfth item.",
867
+ examples: [
868
+ "(1..12).to_list.twelfth",
869
+ "(1..13).to_list.twelfth",
870
+ "[].twelfth"
871
+ ]
872
+ },
873
+ "thirteenth" => {
874
+ name: "thirteenth",
875
+ description: "returns the thirteenth item.",
876
+ examples: [
877
+ "(1..13).to_list.thirteenth",
878
+ "(1..14).to_list.thirteenth",
879
+ "[].thirteenth"
880
+ ]
881
+ },
882
+ "fourteenth" => {
883
+ name: "fourteenth",
884
+ description: "returns the fourteenth item.",
885
+ examples: [
886
+ "(1..14).to_list.fourteenth",
887
+ "(1..15).to_list.fourteenth",
888
+ "[].fourteenth"
889
+ ]
890
+ },
891
+ "fifteenth" => {
892
+ name: "fifteenth",
893
+ description: "returns the fifteenth item.",
894
+ examples: [
895
+ "(1..15).to_list.fifteenth",
896
+ "(1..16).to_list.fifteenth",
897
+ "[].fifteenth"
898
+ ]
899
+ },
900
+ "sixteenth" => {
901
+ name: "sixteenth",
902
+ description: "returns the sixteenth item.",
903
+ examples: [
904
+ "(1..16).to_list.sixteenth",
905
+ "(1..17).to_list.sixteenth",
906
+ "[].sixteenth"
907
+ ]
908
+ },
909
+ "seventeenth" => {
910
+ name: "seventeenth",
911
+ description: "returns the seventeenth item.",
912
+ examples: [
913
+ "(1..17).to_list.seventeenth",
914
+ "(1..18).to_list.seventeenth",
915
+ "[].seventeenth"
916
+ ]
917
+ },
918
+ "eighteenth" => {
919
+ name: "eighteenth",
920
+ description: "returns the eighteenth item.",
921
+ examples: [
922
+ "(1..18).to_list.eighteenth",
923
+ "(1..19).to_list.eighteenth",
924
+ "[].eighteenth"
925
+ ]
926
+ },
927
+ "nineteenth" => {
928
+ name: "nineteenth",
929
+ description: "returns the nineteenth item.",
930
+ examples: [
931
+ "(1..19).to_list.nineteenth",
932
+ "(1..20).to_list.nineteenth",
933
+ "[].nineteenth"
934
+ ]
935
+ },
936
+ "twentieth" => {
937
+ name: "twentieth",
938
+ description: "returns the twentieth item.",
939
+ examples: [
940
+ "(1..20).to_list.twentieth",
941
+ "(1..21).to_list.twentieth",
942
+ "[].twentieth"
943
+ ]
944
+ },
945
+ "twenty_first" => {
946
+ name: "twenty_first",
947
+ description: "returns the twenty first item.",
948
+ examples: [
949
+ "(1..21).to_list.twenty_first",
950
+ "(1..22).to_list.twenty_first",
951
+ "[].twenty_first"
952
+ ]
953
+ },
954
+ "twenty_second" => {
955
+ name: "twenty_second",
956
+ description: "returns the twenty second item.",
957
+ examples: [
958
+ "(1..22).to_list.twenty_second",
959
+ "(1..23).to_list.twenty_second",
960
+ "[].twenty_second"
961
+ ]
962
+ },
963
+ "twenty_third" => {
964
+ name: "twenty_third",
965
+ description: "returns the twenty third item.",
966
+ examples: [
967
+ "(1..23).to_list.twenty_third",
968
+ "(1..24).to_list.twenty_third",
969
+ "[].twenty_third"
970
+ ]
971
+ },
972
+ "twenty_fourth" => {
973
+ name: "twenty_fourth",
974
+ description: "returns the twenty fourth item.",
975
+ examples: [
976
+ "(1..24).to_list.twenty_fourth",
977
+ "(1..25).to_list.twenty_fourth",
978
+ "[].twenty_fourth"
979
+ ]
980
+ },
981
+ "twenty_fifth" => {
982
+ name: "twenty_fifth",
983
+ description: "returns the twenty fifth item.",
984
+ examples: [
985
+ "(1..25).to_list.twenty_fifth",
986
+ "(1..26).to_list.twenty_fifth",
987
+ "[].twenty_fifth"
988
+ ]
989
+ },
990
+ "twenty_sixth" => {
991
+ name: "twenty_sixth",
992
+ description: "returns the twenty sixth item.",
993
+ examples: [
994
+ "(1..26).to_list.twenty_sixth",
995
+ "(1..27).to_list.twenty_sixth",
996
+ "[].twenty_sixth"
997
+ ]
998
+ },
999
+ "twenty_seventh" => {
1000
+ name: "twenty_seventh",
1001
+ description: "returns the twenty seventh item.",
1002
+ examples: [
1003
+ "(1..27).to_list.twenty_seventh",
1004
+ "(1..28).to_list.twenty_seventh",
1005
+ "[].twenty_seventh"
1006
+ ]
1007
+ },
1008
+ "twenty_eighth" => {
1009
+ name: "twenty_eighth",
1010
+ description: "returns the twenty eighth item.",
1011
+ examples: [
1012
+ "(1..28).to_list.twenty_eighth",
1013
+ "(1..29).to_list.twenty_eighth",
1014
+ "[].twenty_eighth"
1015
+ ]
1016
+ },
1017
+ "twenty_ninth" => {
1018
+ name: "twenty_ninth",
1019
+ description: "returns the twenty ninth item.",
1020
+ examples: [
1021
+ "(1..29).to_list.twenty_ninth",
1022
+ "(1..30).to_list.twenty_ninth",
1023
+ "[].twenty_ninth"
1024
+ ]
1025
+ },
1026
+ "thirtieth" => {
1027
+ name: "thirtieth",
1028
+ description: "returns the thirtieth item.",
1029
+ examples: [
1030
+ "(1..30).to_list.thirtieth",
1031
+ "(1..31).to_list.thirtieth",
1032
+ "[].thirtieth"
1033
+ ]
1034
+ },
1035
+ "thirty_first" => {
1036
+ name: "thirty_first",
1037
+ description: "returns the thirty first item.",
1038
+ examples: [
1039
+ "(1..31).to_list.thirty_first",
1040
+ "(1..32).to_list.thirty_first",
1041
+ "[].thirty_first"
1042
+ ]
1043
+ },
1044
+ "thirty_second" => {
1045
+ name: "thirty_second",
1046
+ description: "returns the thirty second item.",
1047
+ examples: [
1048
+ "(1..32).to_list.thirty_second",
1049
+ "(1..33).to_list.thirty_second",
1050
+ "[].thirty_second"
1051
+ ]
1052
+ },
1053
+ "thirty_third" => {
1054
+ name: "thirty_third",
1055
+ description: "returns the thirty third item.",
1056
+ examples: [
1057
+ "(1..33).to_list.thirty_third",
1058
+ "(1..34).to_list.thirty_third",
1059
+ "[].thirty_third"
1060
+ ]
1061
+ },
1062
+ "thirty_fourth" => {
1063
+ name: "thirty_fourth",
1064
+ description: "returns the thirty fourth item.",
1065
+ examples: [
1066
+ "(1..34).to_list.thirty_fourth",
1067
+ "(1..35).to_list.thirty_fourth",
1068
+ "[].thirty_fourth"
1069
+ ]
1070
+ },
1071
+ "thirty_fifth" => {
1072
+ name: "thirty_fifth",
1073
+ description: "returns the thirty fifth item.",
1074
+ examples: [
1075
+ "(1..35).to_list.thirty_fifth",
1076
+ "(1..36).to_list.thirty_fifth",
1077
+ "[].thirty_fifth"
1078
+ ]
1079
+ },
1080
+ "thirty_sixth" => {
1081
+ name: "thirty_sixth",
1082
+ description: "returns the thirty sixth item.",
1083
+ examples: [
1084
+ "(1..36).to_list.thirty_sixth",
1085
+ "(1..37).to_list.thirty_sixth",
1086
+ "[].thirty_sixth"
1087
+ ]
1088
+ },
1089
+ "thirty_seventh" => {
1090
+ name: "thirty_seventh",
1091
+ description: "returns the thirty seventh item.",
1092
+ examples: [
1093
+ "(1..37).to_list.thirty_seventh",
1094
+ "(1..38).to_list.thirty_seventh",
1095
+ "[].thirty_seventh"
1096
+ ]
1097
+ },
1098
+ "thirty_eighth" => {
1099
+ name: "thirty_eighth",
1100
+ description: "returns the thirty eighth item.",
1101
+ examples: [
1102
+ "(1..38).to_list.thirty_eighth",
1103
+ "(1..39).to_list.thirty_eighth",
1104
+ "[].thirty_eighth"
1105
+ ]
1106
+ },
1107
+ "thirty_ninth" => {
1108
+ name: "thirty_ninth",
1109
+ description: "returns the thirty ninth item.",
1110
+ examples: [
1111
+ "(1..39).to_list.thirty_ninth",
1112
+ "(1..40).to_list.thirty_ninth",
1113
+ "[].thirty_ninth"
1114
+ ]
1115
+ },
1116
+ "fortieth" => {
1117
+ name: "fortieth",
1118
+ description: "returns the fortieth item.",
1119
+ examples: [
1120
+ "(1..40).to_list.fortieth",
1121
+ "(1..41).to_list.fortieth",
1122
+ "[].fortieth"
1123
+ ]
1124
+ },
1125
+ "forty_first" => {
1126
+ name: "forty_first",
1127
+ description: "returns the forty first item.",
1128
+ examples: [
1129
+ "(1..41).to_list.forty_first",
1130
+ "(1..42).to_list.forty_first",
1131
+ "[].forty_first"
1132
+ ]
1133
+ },
1134
+ "forty_second" => {
1135
+ name: "forty_second",
1136
+ description: "returns the forty second item.",
1137
+ examples: [
1138
+ "(1..42).to_list.forty_second",
1139
+ "(1..43).to_list.forty_second",
1140
+ "[].forty_second"
1141
+ ]
1142
+ },
1143
+ "forty_third" => {
1144
+ name: "forty_third",
1145
+ description: "returns the forty third item.",
1146
+ examples: [
1147
+ "(1..43).to_list.forty_third",
1148
+ "(1..44).to_list.forty_third",
1149
+ "[].forty_third"
1150
+ ]
1151
+ },
1152
+ "forty_fourth" => {
1153
+ name: "forty_fourth",
1154
+ description: "returns the forty fourth item.",
1155
+ examples: [
1156
+ "(1..44).to_list.forty_fourth",
1157
+ "(1..45).to_list.forty_fourth",
1158
+ "[].forty_fourth"
1159
+ ]
1160
+ },
1161
+ "forty_fifth" => {
1162
+ name: "forty_fifth",
1163
+ description: "returns the forty fifth item.",
1164
+ examples: [
1165
+ "(1..45).to_list.forty_fifth",
1166
+ "(1..46).to_list.forty_fifth",
1167
+ "[].forty_fifth"
1168
+ ]
1169
+ },
1170
+ "forty_sixth" => {
1171
+ name: "forty_sixth",
1172
+ description: "returns the forty sixth item.",
1173
+ examples: [
1174
+ "(1..46).to_list.forty_sixth",
1175
+ "(1..47).to_list.forty_sixth",
1176
+ "[].forty_sixth"
1177
+ ]
1178
+ },
1179
+ "forty_seventh" => {
1180
+ name: "forty_seventh",
1181
+ description: "returns the forty seventh item.",
1182
+ examples: [
1183
+ "(1..47).to_list.forty_seventh",
1184
+ "(1..48).to_list.forty_seventh",
1185
+ "[].forty_seventh"
1186
+ ]
1187
+ },
1188
+ "forty_eighth" => {
1189
+ name: "forty_eighth",
1190
+ description: "returns the forty eighth item.",
1191
+ examples: [
1192
+ "(1..48).to_list.forty_eighth",
1193
+ "(1..49).to_list.forty_eighth",
1194
+ "[].forty_eighth"
1195
+ ]
1196
+ },
1197
+ "forty_ninth" => {
1198
+ name: "forty_ninth",
1199
+ description: "returns the forty ninth item.",
1200
+ examples: [
1201
+ "(1..49).to_list.forty_ninth",
1202
+ "(1..50).to_list.forty_ninth",
1203
+ "[].forty_ninth"
1204
+ ]
1205
+ },
1206
+ "fiftieth" => {
1207
+ name: "fiftieth",
1208
+ description: "returns the fiftieth item.",
1209
+ examples: [
1210
+ "(1..50).to_list.fiftieth",
1211
+ "(1..51).to_list.fiftieth",
1212
+ "[].fiftieth"
1213
+ ]
1214
+ },
1215
+ "fifty_first" => {
1216
+ name: "fifty_first",
1217
+ description: "returns the fifty first item.",
1218
+ examples: [
1219
+ "(1..51).to_list.fifty_first",
1220
+ "(1..52).to_list.fifty_first",
1221
+ "[].fifty_first"
1222
+ ]
1223
+ },
1224
+ "fifty_second" => {
1225
+ name: "fifty_second",
1226
+ description: "returns the fifty second item.",
1227
+ examples: [
1228
+ "(1..52).to_list.fifty_second",
1229
+ "(1..53).to_list.fifty_second",
1230
+ "[].fifty_second"
1231
+ ]
1232
+ },
1233
+ "fifty_third" => {
1234
+ name: "fifty_third",
1235
+ description: "returns the fifty third item.",
1236
+ examples: [
1237
+ "(1..53).to_list.fifty_third",
1238
+ "(1..54).to_list.fifty_third",
1239
+ "[].fifty_third"
1240
+ ]
1241
+ },
1242
+ "fifty_fourth" => {
1243
+ name: "fifty_fourth",
1244
+ description: "returns the fifty fourth item.",
1245
+ examples: [
1246
+ "(1..54).to_list.fifty_fourth",
1247
+ "(1..55).to_list.fifty_fourth",
1248
+ "[].fifty_fourth"
1249
+ ]
1250
+ },
1251
+ "fifty_fifth" => {
1252
+ name: "fifty_fifth",
1253
+ description: "returns the fifty fifth item.",
1254
+ examples: [
1255
+ "(1..55).to_list.fifty_fifth",
1256
+ "(1..56).to_list.fifty_fifth",
1257
+ "[].fifty_fifth"
1258
+ ]
1259
+ },
1260
+ "fifty_sixth" => {
1261
+ name: "fifty_sixth",
1262
+ description: "returns the fifty sixth item.",
1263
+ examples: [
1264
+ "(1..56).to_list.fifty_sixth",
1265
+ "(1..57).to_list.fifty_sixth",
1266
+ "[].fifty_sixth"
1267
+ ]
1268
+ },
1269
+ "fifty_seventh" => {
1270
+ name: "fifty_seventh",
1271
+ description: "returns the fifty seventh item.",
1272
+ examples: [
1273
+ "(1..57).to_list.fifty_seventh",
1274
+ "(1..58).to_list.fifty_seventh",
1275
+ "[].fifty_seventh"
1276
+ ]
1277
+ },
1278
+ "fifty_eighth" => {
1279
+ name: "fifty_eighth",
1280
+ description: "returns the fifty eighth item.",
1281
+ examples: [
1282
+ "(1..58).to_list.fifty_eighth",
1283
+ "(1..59).to_list.fifty_eighth",
1284
+ "[].fifty_eighth"
1285
+ ]
1286
+ },
1287
+ "fifty_ninth" => {
1288
+ name: "fifty_ninth",
1289
+ description: "returns the fifty ninth item.",
1290
+ examples: [
1291
+ "(1..59).to_list.fifty_ninth",
1292
+ "(1..60).to_list.fifty_ninth",
1293
+ "[].fifty_ninth"
1294
+ ]
1295
+ },
1296
+ "sixtieth" => {
1297
+ name: "sixtieth",
1298
+ description: "returns the sixtieth item.",
1299
+ examples: [
1300
+ "(1..60).to_list.sixtieth",
1301
+ "(1..61).to_list.sixtieth",
1302
+ "[].sixtieth"
1303
+ ]
1304
+ },
1305
+ "sixty_first" => {
1306
+ name: "sixty_first",
1307
+ description: "returns the sixty first item.",
1308
+ examples: [
1309
+ "(1..61).to_list.sixty_first",
1310
+ "(1..62).to_list.sixty_first",
1311
+ "[].sixty_first"
1312
+ ]
1313
+ },
1314
+ "sixty_second" => {
1315
+ name: "sixty_second",
1316
+ description: "returns the sixty second item.",
1317
+ examples: [
1318
+ "(1..62).to_list.sixty_second",
1319
+ "(1..63).to_list.sixty_second",
1320
+ "[].sixty_second"
1321
+ ]
1322
+ },
1323
+ "sixty_third" => {
1324
+ name: "sixty_third",
1325
+ description: "returns the sixty third item.",
1326
+ examples: [
1327
+ "(1..63).to_list.sixty_third",
1328
+ "(1..64).to_list.sixty_third",
1329
+ "[].sixty_third"
1330
+ ]
1331
+ },
1332
+ "sixty_fourth" => {
1333
+ name: "sixty_fourth",
1334
+ description: "returns the sixty fourth item.",
1335
+ examples: [
1336
+ "(1..64).to_list.sixty_fourth",
1337
+ "(1..65).to_list.sixty_fourth",
1338
+ "[].sixty_fourth"
1339
+ ]
1340
+ },
1341
+ "sixty_fifth" => {
1342
+ name: "sixty_fifth",
1343
+ description: "returns the sixty fifth item.",
1344
+ examples: [
1345
+ "(1..65).to_list.sixty_fifth",
1346
+ "(1..66).to_list.sixty_fifth",
1347
+ "[].sixty_fifth"
1348
+ ]
1349
+ },
1350
+ "sixty_sixth" => {
1351
+ name: "sixty_sixth",
1352
+ description: "returns the sixty sixth item.",
1353
+ examples: [
1354
+ "(1..66).to_list.sixty_sixth",
1355
+ "(1..67).to_list.sixty_sixth",
1356
+ "[].sixty_sixth"
1357
+ ]
1358
+ },
1359
+ "sixty_seventh" => {
1360
+ name: "sixty_seventh",
1361
+ description: "returns the sixty seventh item.",
1362
+ examples: [
1363
+ "(1..67).to_list.sixty_seventh",
1364
+ "(1..68).to_list.sixty_seventh",
1365
+ "[].sixty_seventh"
1366
+ ]
1367
+ },
1368
+ "sixty_eighth" => {
1369
+ name: "sixty_eighth",
1370
+ description: "returns the sixty eighth item.",
1371
+ examples: [
1372
+ "(1..68).to_list.sixty_eighth",
1373
+ "(1..69).to_list.sixty_eighth",
1374
+ "[].sixty_eighth"
1375
+ ]
1376
+ },
1377
+ "sixty_ninth" => {
1378
+ name: "sixty_ninth",
1379
+ description: "returns the sixty ninth item.",
1380
+ examples: [
1381
+ "(1..69).to_list.sixty_ninth",
1382
+ "(1..70).to_list.sixty_ninth",
1383
+ "[].sixty_ninth"
1384
+ ]
1385
+ },
1386
+ "seventieth" => {
1387
+ name: "seventieth",
1388
+ description: "returns the seventieth item.",
1389
+ examples: [
1390
+ "(1..70).to_list.seventieth",
1391
+ "(1..71).to_list.seventieth",
1392
+ "[].seventieth"
1393
+ ]
1394
+ },
1395
+ "seventy_first" => {
1396
+ name: "seventy_first",
1397
+ description: "returns the seventy first item.",
1398
+ examples: [
1399
+ "(1..71).to_list.seventy_first",
1400
+ "(1..72).to_list.seventy_first",
1401
+ "[].seventy_first"
1402
+ ]
1403
+ },
1404
+ "seventy_second" => {
1405
+ name: "seventy_second",
1406
+ description: "returns the seventy second item.",
1407
+ examples: [
1408
+ "(1..72).to_list.seventy_second",
1409
+ "(1..73).to_list.seventy_second",
1410
+ "[].seventy_second"
1411
+ ]
1412
+ },
1413
+ "seventy_third" => {
1414
+ name: "seventy_third",
1415
+ description: "returns the seventy third item.",
1416
+ examples: [
1417
+ "(1..73).to_list.seventy_third",
1418
+ "(1..74).to_list.seventy_third",
1419
+ "[].seventy_third"
1420
+ ]
1421
+ },
1422
+ "seventy_fourth" => {
1423
+ name: "seventy_fourth",
1424
+ description: "returns the seventy fourth item.",
1425
+ examples: [
1426
+ "(1..74).to_list.seventy_fourth",
1427
+ "(1..75).to_list.seventy_fourth",
1428
+ "[].seventy_fourth"
1429
+ ]
1430
+ },
1431
+ "seventy_fifth" => {
1432
+ name: "seventy_fifth",
1433
+ description: "returns the seventy fifth item.",
1434
+ examples: [
1435
+ "(1..75).to_list.seventy_fifth",
1436
+ "(1..76).to_list.seventy_fifth",
1437
+ "[].seventy_fifth"
1438
+ ]
1439
+ },
1440
+ "seventy_sixth" => {
1441
+ name: "seventy_sixth",
1442
+ description: "returns the seventy sixth item.",
1443
+ examples: [
1444
+ "(1..76).to_list.seventy_sixth",
1445
+ "(1..77).to_list.seventy_sixth",
1446
+ "[].seventy_sixth"
1447
+ ]
1448
+ },
1449
+ "seventy_seventh" => {
1450
+ name: "seventy_seventh",
1451
+ description: "returns the seventy seventh item.",
1452
+ examples: [
1453
+ "(1..77).to_list.seventy_seventh",
1454
+ "(1..78).to_list.seventy_seventh",
1455
+ "[].seventy_seventh"
1456
+ ]
1457
+ },
1458
+ "seventy_eighth" => {
1459
+ name: "seventy_eighth",
1460
+ description: "returns the seventy eighth item.",
1461
+ examples: [
1462
+ "(1..78).to_list.seventy_eighth",
1463
+ "(1..79).to_list.seventy_eighth",
1464
+ "[].seventy_eighth"
1465
+ ]
1466
+ },
1467
+ "seventy_ninth" => {
1468
+ name: "seventy_ninth",
1469
+ description: "returns the seventy ninth item.",
1470
+ examples: [
1471
+ "(1..79).to_list.seventy_ninth",
1472
+ "(1..80).to_list.seventy_ninth",
1473
+ "[].seventy_ninth"
1474
+ ]
1475
+ },
1476
+ "eightieth" => {
1477
+ name: "eightieth",
1478
+ description: "returns the eightieth item.",
1479
+ examples: [
1480
+ "(1..80).to_list.eightieth",
1481
+ "(1..81).to_list.eightieth",
1482
+ "[].eightieth"
1483
+ ]
1484
+ },
1485
+ "eighty_first" => {
1486
+ name: "eighty_first",
1487
+ description: "returns the eighty first item.",
1488
+ examples: [
1489
+ "(1..81).to_list.eighty_first",
1490
+ "(1..82).to_list.eighty_first",
1491
+ "[].eighty_first"
1492
+ ]
1493
+ },
1494
+ "eighty_second" => {
1495
+ name: "eighty_second",
1496
+ description: "returns the eighty second item.",
1497
+ examples: [
1498
+ "(1..82).to_list.eighty_second",
1499
+ "(1..83).to_list.eighty_second",
1500
+ "[].eighty_second"
1501
+ ]
1502
+ },
1503
+ "eighty_third" => {
1504
+ name: "eighty_third",
1505
+ description: "returns the eighty third item.",
1506
+ examples: [
1507
+ "(1..83).to_list.eighty_third",
1508
+ "(1..84).to_list.eighty_third",
1509
+ "[].eighty_third"
1510
+ ]
1511
+ },
1512
+ "eighty_fourth" => {
1513
+ name: "eighty_fourth",
1514
+ description: "returns the eighty fourth item.",
1515
+ examples: [
1516
+ "(1..84).to_list.eighty_fourth",
1517
+ "(1..85).to_list.eighty_fourth",
1518
+ "[].eighty_fourth"
1519
+ ]
1520
+ },
1521
+ "eighty_fifth" => {
1522
+ name: "eighty_fifth",
1523
+ description: "returns the eighty fifth item.",
1524
+ examples: [
1525
+ "(1..85).to_list.eighty_fifth",
1526
+ "(1..86).to_list.eighty_fifth",
1527
+ "[].eighty_fifth"
1528
+ ]
1529
+ },
1530
+ "eighty_sixth" => {
1531
+ name: "eighty_sixth",
1532
+ description: "returns the eighty sixth item.",
1533
+ examples: [
1534
+ "(1..86).to_list.eighty_sixth",
1535
+ "(1..87).to_list.eighty_sixth",
1536
+ "[].eighty_sixth"
1537
+ ]
1538
+ },
1539
+ "eighty_seventh" => {
1540
+ name: "eighty_seventh",
1541
+ description: "returns the eighty seventh item.",
1542
+ examples: [
1543
+ "(1..87).to_list.eighty_seventh",
1544
+ "(1..88).to_list.eighty_seventh",
1545
+ "[].eighty_seventh"
1546
+ ]
1547
+ },
1548
+ "eighty_eighth" => {
1549
+ name: "eighty_eighth",
1550
+ description: "returns the eighty eighth item.",
1551
+ examples: [
1552
+ "(1..88).to_list.eighty_eighth",
1553
+ "(1..89).to_list.eighty_eighth",
1554
+ "[].eighty_eighth"
1555
+ ]
1556
+ },
1557
+ "eighty_ninth" => {
1558
+ name: "eighty_ninth",
1559
+ description: "returns the eighty ninth item.",
1560
+ examples: [
1561
+ "(1..89).to_list.eighty_ninth",
1562
+ "(1..90).to_list.eighty_ninth",
1563
+ "[].eighty_ninth"
1564
+ ]
1565
+ },
1566
+ "ninetieth" => {
1567
+ name: "ninetieth",
1568
+ description: "returns the ninetieth item.",
1569
+ examples: [
1570
+ "(1..90).to_list.ninetieth",
1571
+ "(1..91).to_list.ninetieth",
1572
+ "[].ninetieth"
1573
+ ]
1574
+ },
1575
+ "ninety_first" => {
1576
+ name: "ninety_first",
1577
+ description: "returns the ninety first item.",
1578
+ examples: [
1579
+ "(1..91).to_list.ninety_first",
1580
+ "(1..92).to_list.ninety_first",
1581
+ "[].ninety_first"
1582
+ ]
1583
+ },
1584
+ "ninety_second" => {
1585
+ name: "ninety_second",
1586
+ description: "returns the ninety second item.",
1587
+ examples: [
1588
+ "(1..92).to_list.ninety_second",
1589
+ "(1..93).to_list.ninety_second",
1590
+ "[].ninety_second"
1591
+ ]
1592
+ },
1593
+ "ninety_third" => {
1594
+ name: "ninety_third",
1595
+ description: "returns the ninety third item.",
1596
+ examples: [
1597
+ "(1..93).to_list.ninety_third",
1598
+ "(1..94).to_list.ninety_third",
1599
+ "[].ninety_third"
1600
+ ]
1601
+ },
1602
+ "ninety_fourth" => {
1603
+ name: "ninety_fourth",
1604
+ description: "returns the ninety fourth item.",
1605
+ examples: [
1606
+ "(1..94).to_list.ninety_fourth",
1607
+ "(1..95).to_list.ninety_fourth",
1608
+ "[].ninety_fourth"
1609
+ ]
1610
+ },
1611
+ "ninety_fifth" => {
1612
+ name: "ninety_fifth",
1613
+ description: "returns the ninety fifth item.",
1614
+ examples: [
1615
+ "(1..95).to_list.ninety_fifth",
1616
+ "(1..96).to_list.ninety_fifth",
1617
+ "[].ninety_fifth"
1618
+ ]
1619
+ },
1620
+ "ninety_sixth" => {
1621
+ name: "ninety_sixth",
1622
+ description: "returns the ninety sixth item.",
1623
+ examples: [
1624
+ "(1..96).to_list.ninety_sixth",
1625
+ "(1..97).to_list.ninety_sixth",
1626
+ "[].ninety_sixth"
1627
+ ]
1628
+ },
1629
+ "ninety_seventh" => {
1630
+ name: "ninety_seventh",
1631
+ description: "returns the ninety seventh item.",
1632
+ examples: [
1633
+ "(1..97).to_list.ninety_seventh",
1634
+ "(1..98).to_list.ninety_seventh",
1635
+ "[].ninety_seventh"
1636
+ ]
1637
+ },
1638
+ "ninety_eighth" => {
1639
+ name: "ninety_eighth",
1640
+ description: "returns the ninety eighth item.",
1641
+ examples: [
1642
+ "(1..98).to_list.ninety_eighth",
1643
+ "(1..99).to_list.ninety_eighth",
1644
+ "[].ninety_eighth"
1645
+ ]
1646
+ },
1647
+ "ninety_ninth" => {
1648
+ name: "ninety_ninth",
1649
+ description: "returns the ninety ninth item.",
1650
+ examples: [
1651
+ "(1..99).to_list.ninety_ninth",
1652
+ "(1..100).to_list.ninety_ninth",
1653
+ "[].ninety_ninth"
1654
+ ]
1655
+ },
1656
+ "one_hundredth" => {
1657
+ name: "one_hundredth",
1658
+ description: "returns the one hundredth item.",
1659
+ examples: [
1660
+ "(1..100).to_list.one_hundredth",
1661
+ "(1..101).to_list.one_hundredth",
1662
+ "[].one_hundredth"
1663
+ ]
1664
+ },
1665
+ "many?" => {
1666
+ name: "many?",
1667
+ description: "returns whether the list has more than one item.",
1668
+ examples: ["[1, 2].many?", "[1].many?", "[].many?"]
1669
+ },
1670
+ "positive?" => {
1671
+ name: "positive?",
1672
+ description: "returns whether the list size is positive.",
1673
+ examples: ["[1].positive?", "[].positive?", "[1, 2].positive?"]
1674
+ },
1675
+ "negative?" => {
1676
+ name: "negative?",
1677
+ description: "returns whether the list size is negative.",
1678
+ examples: ["[].negative?", "[1].negative?", "[1, 2].negative?"]
1679
+ },
1680
+ "zero?" => {
1681
+ name: "zero?",
1682
+ description: "returns whether the list size is zero.",
1683
+ examples: [
1684
+ "(1..0).to_list.zero?",
1685
+ "(1..1).to_list.zero?",
1686
+ "[].zero?"
1687
+ ]
1688
+ },
1689
+ "one?" => {
1690
+ name: "one?",
1691
+ description: "returns whether the list size is one.",
1692
+ examples: [
1693
+ "(1..1).to_list.one?",
1694
+ "(1..2).to_list.one?",
1695
+ "[].one?"
1696
+ ]
1697
+ },
1698
+ "two?" => {
1699
+ name: "two?",
1700
+ description: "returns whether the list size is two.",
1701
+ examples: [
1702
+ "(1..2).to_list.two?",
1703
+ "(1..3).to_list.two?",
1704
+ "[].two?"
1705
+ ]
1706
+ },
1707
+ "three?" => {
1708
+ name: "three?",
1709
+ description: "returns whether the list size is three.",
1710
+ examples: [
1711
+ "(1..3).to_list.three?",
1712
+ "(1..4).to_list.three?",
1713
+ "[].three?"
1714
+ ]
1715
+ },
1716
+ "four?" => {
1717
+ name: "four?",
1718
+ description: "returns whether the list size is four.",
1719
+ examples: [
1720
+ "(1..4).to_list.four?",
1721
+ "(1..5).to_list.four?",
1722
+ "[].four?"
1723
+ ]
1724
+ },
1725
+ "five?" => {
1726
+ name: "five?",
1727
+ description: "returns whether the list size is five.",
1728
+ examples: [
1729
+ "(1..5).to_list.five?",
1730
+ "(1..6).to_list.five?",
1731
+ "[].five?"
1732
+ ]
1733
+ },
1734
+ "six?" => {
1735
+ name: "six?",
1736
+ description: "returns whether the list size is six.",
1737
+ examples: [
1738
+ "(1..6).to_list.six?",
1739
+ "(1..7).to_list.six?",
1740
+ "[].six?"
1741
+ ]
1742
+ },
1743
+ "seven?" => {
1744
+ name: "seven?",
1745
+ description: "returns whether the list size is seven.",
1746
+ examples: [
1747
+ "(1..7).to_list.seven?",
1748
+ "(1..8).to_list.seven?",
1749
+ "[].seven?"
1750
+ ]
1751
+ },
1752
+ "eight?" => {
1753
+ name: "eight?",
1754
+ description: "returns whether the list size is eight.",
1755
+ examples: [
1756
+ "(1..8).to_list.eight?",
1757
+ "(1..9).to_list.eight?",
1758
+ "[].eight?"
1759
+ ]
1760
+ },
1761
+ "nine?" => {
1762
+ name: "nine?",
1763
+ description: "returns whether the list size is nine.",
1764
+ examples: [
1765
+ "(1..9).to_list.nine?",
1766
+ "(1..10).to_list.nine?",
1767
+ "[].nine?"
1768
+ ]
1769
+ },
1770
+ "ten?" => {
1771
+ name: "ten?",
1772
+ description: "returns whether the list size is ten.",
1773
+ examples: [
1774
+ "(1..10).to_list.ten?",
1775
+ "(1..11).to_list.ten?",
1776
+ "[].ten?"
1777
+ ]
1778
+ },
1779
+ "eleven?" => {
1780
+ name: "eleven?",
1781
+ description: "returns whether the list size is eleven.",
1782
+ examples: [
1783
+ "(1..11).to_list.eleven?",
1784
+ "(1..12).to_list.eleven?",
1785
+ "[].eleven?"
1786
+ ]
1787
+ },
1788
+ "twelve?" => {
1789
+ name: "twelve?",
1790
+ description: "returns whether the list size is twelve.",
1791
+ examples: [
1792
+ "(1..12).to_list.twelve?",
1793
+ "(1..13).to_list.twelve?",
1794
+ "[].twelve?"
1795
+ ]
1796
+ },
1797
+ "thirteen?" => {
1798
+ name: "thirteen?",
1799
+ description: "returns whether the list size is thirteen.",
1800
+ examples: [
1801
+ "(1..13).to_list.thirteen?",
1802
+ "(1..14).to_list.thirteen?",
1803
+ "[].thirteen?"
1804
+ ]
1805
+ },
1806
+ "fourteen?" => {
1807
+ name: "fourteen?",
1808
+ description: "returns whether the list size is fourteen.",
1809
+ examples: [
1810
+ "(1..14).to_list.fourteen?",
1811
+ "(1..15).to_list.fourteen?",
1812
+ "[].fourteen?"
1813
+ ]
1814
+ },
1815
+ "fifteen?" => {
1816
+ name: "fifteen?",
1817
+ description: "returns whether the list size is fifteen.",
1818
+ examples: [
1819
+ "(1..15).to_list.fifteen?",
1820
+ "(1..16).to_list.fifteen?",
1821
+ "[].fifteen?"
1822
+ ]
1823
+ },
1824
+ "sixteen?" => {
1825
+ name: "sixteen?",
1826
+ description: "returns whether the list size is sixteen.",
1827
+ examples: [
1828
+ "(1..16).to_list.sixteen?",
1829
+ "(1..17).to_list.sixteen?",
1830
+ "[].sixteen?"
1831
+ ]
1832
+ },
1833
+ "seventeen?" => {
1834
+ name: "seventeen?",
1835
+ description: "returns whether the list size is seventeen.",
1836
+ examples: [
1837
+ "(1..17).to_list.seventeen?",
1838
+ "(1..18).to_list.seventeen?",
1839
+ "[].seventeen?"
1840
+ ]
1841
+ },
1842
+ "eighteen?" => {
1843
+ name: "eighteen?",
1844
+ description: "returns whether the list size is eighteen.",
1845
+ examples: [
1846
+ "(1..18).to_list.eighteen?",
1847
+ "(1..19).to_list.eighteen?",
1848
+ "[].eighteen?"
1849
+ ]
1850
+ },
1851
+ "nineteen?" => {
1852
+ name: "nineteen?",
1853
+ description: "returns whether the list size is nineteen.",
1854
+ examples: [
1855
+ "(1..19).to_list.nineteen?",
1856
+ "(1..20).to_list.nineteen?",
1857
+ "[].nineteen?"
1858
+ ]
1859
+ },
1860
+ "twenty?" => {
1861
+ name: "twenty?",
1862
+ description: "returns whether the list size is twenty.",
1863
+ examples: [
1864
+ "(1..20).to_list.twenty?",
1865
+ "(1..21).to_list.twenty?",
1866
+ "[].twenty?"
1867
+ ]
1868
+ },
1869
+ "twenty_one?" => {
1870
+ name: "twenty_one?",
1871
+ description: "returns whether the list size is twenty one.",
1872
+ examples: [
1873
+ "(1..21).to_list.twenty_one?",
1874
+ "(1..22).to_list.twenty_one?",
1875
+ "[].twenty_one?"
1876
+ ]
1877
+ },
1878
+ "twenty_two?" => {
1879
+ name: "twenty_two?",
1880
+ description: "returns whether the list size is twenty two.",
1881
+ examples: [
1882
+ "(1..22).to_list.twenty_two?",
1883
+ "(1..23).to_list.twenty_two?",
1884
+ "[].twenty_two?"
1885
+ ]
1886
+ },
1887
+ "twenty_three?" => {
1888
+ name: "twenty_three?",
1889
+ description: "returns whether the list size is twenty three.",
1890
+ examples: [
1891
+ "(1..23).to_list.twenty_three?",
1892
+ "(1..24).to_list.twenty_three?",
1893
+ "[].twenty_three?"
1894
+ ]
1895
+ },
1896
+ "twenty_four?" => {
1897
+ name: "twenty_four?",
1898
+ description: "returns whether the list size is twenty four.",
1899
+ examples: [
1900
+ "(1..24).to_list.twenty_four?",
1901
+ "(1..25).to_list.twenty_four?",
1902
+ "[].twenty_four?"
1903
+ ]
1904
+ },
1905
+ "twenty_five?" => {
1906
+ name: "twenty_five?",
1907
+ description: "returns whether the list size is twenty five.",
1908
+ examples: [
1909
+ "(1..25).to_list.twenty_five?",
1910
+ "(1..26).to_list.twenty_five?",
1911
+ "[].twenty_five?"
1912
+ ]
1913
+ },
1914
+ "twenty_six?" => {
1915
+ name: "twenty_six?",
1916
+ description: "returns whether the list size is twenty six.",
1917
+ examples: [
1918
+ "(1..26).to_list.twenty_six?",
1919
+ "(1..27).to_list.twenty_six?",
1920
+ "[].twenty_six?"
1921
+ ]
1922
+ },
1923
+ "twenty_seven?" => {
1924
+ name: "twenty_seven?",
1925
+ description: "returns whether the list size is twenty seven.",
1926
+ examples: [
1927
+ "(1..27).to_list.twenty_seven?",
1928
+ "(1..28).to_list.twenty_seven?",
1929
+ "[].twenty_seven?"
1930
+ ]
1931
+ },
1932
+ "twenty_eight?" => {
1933
+ name: "twenty_eight?",
1934
+ description: "returns whether the list size is twenty eight.",
1935
+ examples: [
1936
+ "(1..28).to_list.twenty_eight?",
1937
+ "(1..29).to_list.twenty_eight?",
1938
+ "[].twenty_eight?"
1939
+ ]
1940
+ },
1941
+ "twenty_nine?" => {
1942
+ name: "twenty_nine?",
1943
+ description: "returns whether the list size is twenty nine.",
1944
+ examples: [
1945
+ "(1..29).to_list.twenty_nine?",
1946
+ "(1..30).to_list.twenty_nine?",
1947
+ "[].twenty_nine?"
1948
+ ]
1949
+ },
1950
+ "thirty?" => {
1951
+ name: "thirty?",
1952
+ description: "returns whether the list size is thirty.",
1953
+ examples: [
1954
+ "(1..30).to_list.thirty?",
1955
+ "(1..31).to_list.thirty?",
1956
+ "[].thirty?"
1957
+ ]
1958
+ },
1959
+ "thirty_one?" => {
1960
+ name: "thirty_one?",
1961
+ description: "returns whether the list size is thirty one.",
1962
+ examples: [
1963
+ "(1..31).to_list.thirty_one?",
1964
+ "(1..32).to_list.thirty_one?",
1965
+ "[].thirty_one?"
1966
+ ]
1967
+ },
1968
+ "thirty_two?" => {
1969
+ name: "thirty_two?",
1970
+ description: "returns whether the list size is thirty two.",
1971
+ examples: [
1972
+ "(1..32).to_list.thirty_two?",
1973
+ "(1..33).to_list.thirty_two?",
1974
+ "[].thirty_two?"
1975
+ ]
1976
+ },
1977
+ "thirty_three?" => {
1978
+ name: "thirty_three?",
1979
+ description: "returns whether the list size is thirty three.",
1980
+ examples: [
1981
+ "(1..33).to_list.thirty_three?",
1982
+ "(1..34).to_list.thirty_three?",
1983
+ "[].thirty_three?"
1984
+ ]
1985
+ },
1986
+ "thirty_four?" => {
1987
+ name: "thirty_four?",
1988
+ description: "returns whether the list size is thirty four.",
1989
+ examples: [
1990
+ "(1..34).to_list.thirty_four?",
1991
+ "(1..35).to_list.thirty_four?",
1992
+ "[].thirty_four?"
1993
+ ]
1994
+ },
1995
+ "thirty_five?" => {
1996
+ name: "thirty_five?",
1997
+ description: "returns whether the list size is thirty five.",
1998
+ examples: [
1999
+ "(1..35).to_list.thirty_five?",
2000
+ "(1..36).to_list.thirty_five?",
2001
+ "[].thirty_five?"
2002
+ ]
2003
+ },
2004
+ "thirty_six?" => {
2005
+ name: "thirty_six?",
2006
+ description: "returns whether the list size is thirty six.",
2007
+ examples: [
2008
+ "(1..36).to_list.thirty_six?",
2009
+ "(1..37).to_list.thirty_six?",
2010
+ "[].thirty_six?"
2011
+ ]
2012
+ },
2013
+ "thirty_seven?" => {
2014
+ name: "thirty_seven?",
2015
+ description: "returns whether the list size is thirty seven.",
2016
+ examples: [
2017
+ "(1..37).to_list.thirty_seven?",
2018
+ "(1..38).to_list.thirty_seven?",
2019
+ "[].thirty_seven?"
2020
+ ]
2021
+ },
2022
+ "thirty_eight?" => {
2023
+ name: "thirty_eight?",
2024
+ description: "returns whether the list size is thirty eight.",
2025
+ examples: [
2026
+ "(1..38).to_list.thirty_eight?",
2027
+ "(1..39).to_list.thirty_eight?",
2028
+ "[].thirty_eight?"
2029
+ ]
2030
+ },
2031
+ "thirty_nine?" => {
2032
+ name: "thirty_nine?",
2033
+ description: "returns whether the list size is thirty nine.",
2034
+ examples: [
2035
+ "(1..39).to_list.thirty_nine?",
2036
+ "(1..40).to_list.thirty_nine?",
2037
+ "[].thirty_nine?"
2038
+ ]
2039
+ },
2040
+ "forty?" => {
2041
+ name: "forty?",
2042
+ description: "returns whether the list size is forty.",
2043
+ examples: [
2044
+ "(1..40).to_list.forty?",
2045
+ "(1..41).to_list.forty?",
2046
+ "[].forty?"
2047
+ ]
2048
+ },
2049
+ "forty_one?" => {
2050
+ name: "forty_one?",
2051
+ description: "returns whether the list size is forty one.",
2052
+ examples: [
2053
+ "(1..41).to_list.forty_one?",
2054
+ "(1..42).to_list.forty_one?",
2055
+ "[].forty_one?"
2056
+ ]
2057
+ },
2058
+ "forty_two?" => {
2059
+ name: "forty_two?",
2060
+ description: "returns whether the list size is forty two.",
2061
+ examples: [
2062
+ "(1..42).to_list.forty_two?",
2063
+ "(1..43).to_list.forty_two?",
2064
+ "[].forty_two?"
2065
+ ]
2066
+ },
2067
+ "forty_three?" => {
2068
+ name: "forty_three?",
2069
+ description: "returns whether the list size is forty three.",
2070
+ examples: [
2071
+ "(1..43).to_list.forty_three?",
2072
+ "(1..44).to_list.forty_three?",
2073
+ "[].forty_three?"
2074
+ ]
2075
+ },
2076
+ "forty_four?" => {
2077
+ name: "forty_four?",
2078
+ description: "returns whether the list size is forty four.",
2079
+ examples: [
2080
+ "(1..44).to_list.forty_four?",
2081
+ "(1..45).to_list.forty_four?",
2082
+ "[].forty_four?"
2083
+ ]
2084
+ },
2085
+ "forty_five?" => {
2086
+ name: "forty_five?",
2087
+ description: "returns whether the list size is forty five.",
2088
+ examples: [
2089
+ "(1..45).to_list.forty_five?",
2090
+ "(1..46).to_list.forty_five?",
2091
+ "[].forty_five?"
2092
+ ]
2093
+ },
2094
+ "forty_six?" => {
2095
+ name: "forty_six?",
2096
+ description: "returns whether the list size is forty six.",
2097
+ examples: [
2098
+ "(1..46).to_list.forty_six?",
2099
+ "(1..47).to_list.forty_six?",
2100
+ "[].forty_six?"
2101
+ ]
2102
+ },
2103
+ "forty_seven?" => {
2104
+ name: "forty_seven?",
2105
+ description: "returns whether the list size is forty seven.",
2106
+ examples: [
2107
+ "(1..47).to_list.forty_seven?",
2108
+ "(1..48).to_list.forty_seven?",
2109
+ "[].forty_seven?"
2110
+ ]
2111
+ },
2112
+ "forty_eight?" => {
2113
+ name: "forty_eight?",
2114
+ description: "returns whether the list size is forty eight.",
2115
+ examples: [
2116
+ "(1..48).to_list.forty_eight?",
2117
+ "(1..49).to_list.forty_eight?",
2118
+ "[].forty_eight?"
2119
+ ]
2120
+ },
2121
+ "forty_nine?" => {
2122
+ name: "forty_nine?",
2123
+ description: "returns whether the list size is forty nine.",
2124
+ examples: [
2125
+ "(1..49).to_list.forty_nine?",
2126
+ "(1..50).to_list.forty_nine?",
2127
+ "[].forty_nine?"
2128
+ ]
2129
+ },
2130
+ "fifty?" => {
2131
+ name: "fifty?",
2132
+ description: "returns whether the list size is fifty.",
2133
+ examples: [
2134
+ "(1..50).to_list.fifty?",
2135
+ "(1..51).to_list.fifty?",
2136
+ "[].fifty?"
2137
+ ]
2138
+ },
2139
+ "fifty_one?" => {
2140
+ name: "fifty_one?",
2141
+ description: "returns whether the list size is fifty one.",
2142
+ examples: [
2143
+ "(1..51).to_list.fifty_one?",
2144
+ "(1..52).to_list.fifty_one?",
2145
+ "[].fifty_one?"
2146
+ ]
2147
+ },
2148
+ "fifty_two?" => {
2149
+ name: "fifty_two?",
2150
+ description: "returns whether the list size is fifty two.",
2151
+ examples: [
2152
+ "(1..52).to_list.fifty_two?",
2153
+ "(1..53).to_list.fifty_two?",
2154
+ "[].fifty_two?"
2155
+ ]
2156
+ },
2157
+ "fifty_three?" => {
2158
+ name: "fifty_three?",
2159
+ description: "returns whether the list size is fifty three.",
2160
+ examples: [
2161
+ "(1..53).to_list.fifty_three?",
2162
+ "(1..54).to_list.fifty_three?",
2163
+ "[].fifty_three?"
2164
+ ]
2165
+ },
2166
+ "fifty_four?" => {
2167
+ name: "fifty_four?",
2168
+ description: "returns whether the list size is fifty four.",
2169
+ examples: [
2170
+ "(1..54).to_list.fifty_four?",
2171
+ "(1..55).to_list.fifty_four?",
2172
+ "[].fifty_four?"
2173
+ ]
2174
+ },
2175
+ "fifty_five?" => {
2176
+ name: "fifty_five?",
2177
+ description: "returns whether the list size is fifty five.",
2178
+ examples: [
2179
+ "(1..55).to_list.fifty_five?",
2180
+ "(1..56).to_list.fifty_five?",
2181
+ "[].fifty_five?"
2182
+ ]
2183
+ },
2184
+ "fifty_six?" => {
2185
+ name: "fifty_six?",
2186
+ description: "returns whether the list size is fifty six.",
2187
+ examples: [
2188
+ "(1..56).to_list.fifty_six?",
2189
+ "(1..57).to_list.fifty_six?",
2190
+ "[].fifty_six?"
2191
+ ]
2192
+ },
2193
+ "fifty_seven?" => {
2194
+ name: "fifty_seven?",
2195
+ description: "returns whether the list size is fifty seven.",
2196
+ examples: [
2197
+ "(1..57).to_list.fifty_seven?",
2198
+ "(1..58).to_list.fifty_seven?",
2199
+ "[].fifty_seven?"
2200
+ ]
2201
+ },
2202
+ "fifty_eight?" => {
2203
+ name: "fifty_eight?",
2204
+ description: "returns whether the list size is fifty eight.",
2205
+ examples: [
2206
+ "(1..58).to_list.fifty_eight?",
2207
+ "(1..59).to_list.fifty_eight?",
2208
+ "[].fifty_eight?"
2209
+ ]
2210
+ },
2211
+ "fifty_nine?" => {
2212
+ name: "fifty_nine?",
2213
+ description: "returns whether the list size is fifty nine.",
2214
+ examples: [
2215
+ "(1..59).to_list.fifty_nine?",
2216
+ "(1..60).to_list.fifty_nine?",
2217
+ "[].fifty_nine?"
2218
+ ]
2219
+ },
2220
+ "sixty?" => {
2221
+ name: "sixty?",
2222
+ description: "returns whether the list size is sixty.",
2223
+ examples: [
2224
+ "(1..60).to_list.sixty?",
2225
+ "(1..61).to_list.sixty?",
2226
+ "[].sixty?"
2227
+ ]
2228
+ },
2229
+ "sixty_one?" => {
2230
+ name: "sixty_one?",
2231
+ description: "returns whether the list size is sixty one.",
2232
+ examples: [
2233
+ "(1..61).to_list.sixty_one?",
2234
+ "(1..62).to_list.sixty_one?",
2235
+ "[].sixty_one?"
2236
+ ]
2237
+ },
2238
+ "sixty_two?" => {
2239
+ name: "sixty_two?",
2240
+ description: "returns whether the list size is sixty two.",
2241
+ examples: [
2242
+ "(1..62).to_list.sixty_two?",
2243
+ "(1..63).to_list.sixty_two?",
2244
+ "[].sixty_two?"
2245
+ ]
2246
+ },
2247
+ "sixty_three?" => {
2248
+ name: "sixty_three?",
2249
+ description: "returns whether the list size is sixty three.",
2250
+ examples: [
2251
+ "(1..63).to_list.sixty_three?",
2252
+ "(1..64).to_list.sixty_three?",
2253
+ "[].sixty_three?"
2254
+ ]
2255
+ },
2256
+ "sixty_four?" => {
2257
+ name: "sixty_four?",
2258
+ description: "returns whether the list size is sixty four.",
2259
+ examples: [
2260
+ "(1..64).to_list.sixty_four?",
2261
+ "(1..65).to_list.sixty_four?",
2262
+ "[].sixty_four?"
2263
+ ]
2264
+ },
2265
+ "sixty_five?" => {
2266
+ name: "sixty_five?",
2267
+ description: "returns whether the list size is sixty five.",
2268
+ examples: [
2269
+ "(1..65).to_list.sixty_five?",
2270
+ "(1..66).to_list.sixty_five?",
2271
+ "[].sixty_five?"
2272
+ ]
2273
+ },
2274
+ "sixty_six?" => {
2275
+ name: "sixty_six?",
2276
+ description: "returns whether the list size is sixty six.",
2277
+ examples: [
2278
+ "(1..66).to_list.sixty_six?",
2279
+ "(1..67).to_list.sixty_six?",
2280
+ "[].sixty_six?"
2281
+ ]
2282
+ },
2283
+ "sixty_seven?" => {
2284
+ name: "sixty_seven?",
2285
+ description: "returns whether the list size is sixty seven.",
2286
+ examples: [
2287
+ "(1..67).to_list.sixty_seven?",
2288
+ "(1..68).to_list.sixty_seven?",
2289
+ "[].sixty_seven?"
2290
+ ]
2291
+ },
2292
+ "sixty_eight?" => {
2293
+ name: "sixty_eight?",
2294
+ description: "returns whether the list size is sixty eight.",
2295
+ examples: [
2296
+ "(1..68).to_list.sixty_eight?",
2297
+ "(1..69).to_list.sixty_eight?",
2298
+ "[].sixty_eight?"
2299
+ ]
2300
+ },
2301
+ "sixty_nine?" => {
2302
+ name: "sixty_nine?",
2303
+ description: "returns whether the list size is sixty nine.",
2304
+ examples: [
2305
+ "(1..69).to_list.sixty_nine?",
2306
+ "(1..70).to_list.sixty_nine?",
2307
+ "[].sixty_nine?"
2308
+ ]
2309
+ },
2310
+ "seventy?" => {
2311
+ name: "seventy?",
2312
+ description: "returns whether the list size is seventy.",
2313
+ examples: [
2314
+ "(1..70).to_list.seventy?",
2315
+ "(1..71).to_list.seventy?",
2316
+ "[].seventy?"
2317
+ ]
2318
+ },
2319
+ "seventy_one?" => {
2320
+ name: "seventy_one?",
2321
+ description: "returns whether the list size is seventy one.",
2322
+ examples: [
2323
+ "(1..71).to_list.seventy_one?",
2324
+ "(1..72).to_list.seventy_one?",
2325
+ "[].seventy_one?"
2326
+ ]
2327
+ },
2328
+ "seventy_two?" => {
2329
+ name: "seventy_two?",
2330
+ description: "returns whether the list size is seventy two.",
2331
+ examples: [
2332
+ "(1..72).to_list.seventy_two?",
2333
+ "(1..73).to_list.seventy_two?",
2334
+ "[].seventy_two?"
2335
+ ]
2336
+ },
2337
+ "seventy_three?" => {
2338
+ name: "seventy_three?",
2339
+ description: "returns whether the list size is seventy three.",
2340
+ examples: [
2341
+ "(1..73).to_list.seventy_three?",
2342
+ "(1..74).to_list.seventy_three?",
2343
+ "[].seventy_three?"
2344
+ ]
2345
+ },
2346
+ "seventy_four?" => {
2347
+ name: "seventy_four?",
2348
+ description: "returns whether the list size is seventy four.",
2349
+ examples: [
2350
+ "(1..74).to_list.seventy_four?",
2351
+ "(1..75).to_list.seventy_four?",
2352
+ "[].seventy_four?"
2353
+ ]
2354
+ },
2355
+ "seventy_five?" => {
2356
+ name: "seventy_five?",
2357
+ description: "returns whether the list size is seventy five.",
2358
+ examples: [
2359
+ "(1..75).to_list.seventy_five?",
2360
+ "(1..76).to_list.seventy_five?",
2361
+ "[].seventy_five?"
2362
+ ]
2363
+ },
2364
+ "seventy_six?" => {
2365
+ name: "seventy_six?",
2366
+ description: "returns whether the list size is seventy six.",
2367
+ examples: [
2368
+ "(1..76).to_list.seventy_six?",
2369
+ "(1..77).to_list.seventy_six?",
2370
+ "[].seventy_six?"
2371
+ ]
2372
+ },
2373
+ "seventy_seven?" => {
2374
+ name: "seventy_seven?",
2375
+ description: "returns whether the list size is seventy seven.",
2376
+ examples: [
2377
+ "(1..77).to_list.seventy_seven?",
2378
+ "(1..78).to_list.seventy_seven?",
2379
+ "[].seventy_seven?"
2380
+ ]
2381
+ },
2382
+ "seventy_eight?" => {
2383
+ name: "seventy_eight?",
2384
+ description: "returns whether the list size is seventy eight.",
2385
+ examples: [
2386
+ "(1..78).to_list.seventy_eight?",
2387
+ "(1..79).to_list.seventy_eight?",
2388
+ "[].seventy_eight?"
2389
+ ]
2390
+ },
2391
+ "seventy_nine?" => {
2392
+ name: "seventy_nine?",
2393
+ description: "returns whether the list size is seventy nine.",
2394
+ examples: [
2395
+ "(1..79).to_list.seventy_nine?",
2396
+ "(1..80).to_list.seventy_nine?",
2397
+ "[].seventy_nine?"
2398
+ ]
2399
+ },
2400
+ "eighty?" => {
2401
+ name: "eighty?",
2402
+ description: "returns whether the list size is eighty.",
2403
+ examples: [
2404
+ "(1..80).to_list.eighty?",
2405
+ "(1..81).to_list.eighty?",
2406
+ "[].eighty?"
2407
+ ]
2408
+ },
2409
+ "eighty_one?" => {
2410
+ name: "eighty_one?",
2411
+ description: "returns whether the list size is eighty one.",
2412
+ examples: [
2413
+ "(1..81).to_list.eighty_one?",
2414
+ "(1..82).to_list.eighty_one?",
2415
+ "[].eighty_one?"
2416
+ ]
2417
+ },
2418
+ "eighty_two?" => {
2419
+ name: "eighty_two?",
2420
+ description: "returns whether the list size is eighty two.",
2421
+ examples: [
2422
+ "(1..82).to_list.eighty_two?",
2423
+ "(1..83).to_list.eighty_two?",
2424
+ "[].eighty_two?"
2425
+ ]
2426
+ },
2427
+ "eighty_three?" => {
2428
+ name: "eighty_three?",
2429
+ description: "returns whether the list size is eighty three.",
2430
+ examples: [
2431
+ "(1..83).to_list.eighty_three?",
2432
+ "(1..84).to_list.eighty_three?",
2433
+ "[].eighty_three?"
2434
+ ]
2435
+ },
2436
+ "eighty_four?" => {
2437
+ name: "eighty_four?",
2438
+ description: "returns whether the list size is eighty four.",
2439
+ examples: [
2440
+ "(1..84).to_list.eighty_four?",
2441
+ "(1..85).to_list.eighty_four?",
2442
+ "[].eighty_four?"
2443
+ ]
2444
+ },
2445
+ "eighty_five?" => {
2446
+ name: "eighty_five?",
2447
+ description: "returns whether the list size is eighty five.",
2448
+ examples: [
2449
+ "(1..85).to_list.eighty_five?",
2450
+ "(1..86).to_list.eighty_five?",
2451
+ "[].eighty_five?"
2452
+ ]
2453
+ },
2454
+ "eighty_six?" => {
2455
+ name: "eighty_six?",
2456
+ description: "returns whether the list size is eighty six.",
2457
+ examples: [
2458
+ "(1..86).to_list.eighty_six?",
2459
+ "(1..87).to_list.eighty_six?",
2460
+ "[].eighty_six?"
2461
+ ]
2462
+ },
2463
+ "eighty_seven?" => {
2464
+ name: "eighty_seven?",
2465
+ description: "returns whether the list size is eighty seven.",
2466
+ examples: [
2467
+ "(1..87).to_list.eighty_seven?",
2468
+ "(1..88).to_list.eighty_seven?",
2469
+ "[].eighty_seven?"
2470
+ ]
2471
+ },
2472
+ "eighty_eight?" => {
2473
+ name: "eighty_eight?",
2474
+ description: "returns whether the list size is eighty eight.",
2475
+ examples: [
2476
+ "(1..88).to_list.eighty_eight?",
2477
+ "(1..89).to_list.eighty_eight?",
2478
+ "[].eighty_eight?"
2479
+ ]
2480
+ },
2481
+ "eighty_nine?" => {
2482
+ name: "eighty_nine?",
2483
+ description: "returns whether the list size is eighty nine.",
2484
+ examples: [
2485
+ "(1..89).to_list.eighty_nine?",
2486
+ "(1..90).to_list.eighty_nine?",
2487
+ "[].eighty_nine?"
2488
+ ]
2489
+ },
2490
+ "ninety?" => {
2491
+ name: "ninety?",
2492
+ description: "returns whether the list size is ninety.",
2493
+ examples: [
2494
+ "(1..90).to_list.ninety?",
2495
+ "(1..91).to_list.ninety?",
2496
+ "[].ninety?"
2497
+ ]
2498
+ },
2499
+ "ninety_one?" => {
2500
+ name: "ninety_one?",
2501
+ description: "returns whether the list size is ninety one.",
2502
+ examples: [
2503
+ "(1..91).to_list.ninety_one?",
2504
+ "(1..92).to_list.ninety_one?",
2505
+ "[].ninety_one?"
2506
+ ]
2507
+ },
2508
+ "ninety_two?" => {
2509
+ name: "ninety_two?",
2510
+ description: "returns whether the list size is ninety two.",
2511
+ examples: [
2512
+ "(1..92).to_list.ninety_two?",
2513
+ "(1..93).to_list.ninety_two?",
2514
+ "[].ninety_two?"
2515
+ ]
2516
+ },
2517
+ "ninety_three?" => {
2518
+ name: "ninety_three?",
2519
+ description: "returns whether the list size is ninety three.",
2520
+ examples: [
2521
+ "(1..93).to_list.ninety_three?",
2522
+ "(1..94).to_list.ninety_three?",
2523
+ "[].ninety_three?"
2524
+ ]
2525
+ },
2526
+ "ninety_four?" => {
2527
+ name: "ninety_four?",
2528
+ description: "returns whether the list size is ninety four.",
2529
+ examples: [
2530
+ "(1..94).to_list.ninety_four?",
2531
+ "(1..95).to_list.ninety_four?",
2532
+ "[].ninety_four?"
2533
+ ]
2534
+ },
2535
+ "ninety_five?" => {
2536
+ name: "ninety_five?",
2537
+ description: "returns whether the list size is ninety five.",
2538
+ examples: [
2539
+ "(1..95).to_list.ninety_five?",
2540
+ "(1..96).to_list.ninety_five?",
2541
+ "[].ninety_five?"
2542
+ ]
2543
+ },
2544
+ "ninety_six?" => {
2545
+ name: "ninety_six?",
2546
+ description: "returns whether the list size is ninety six.",
2547
+ examples: [
2548
+ "(1..96).to_list.ninety_six?",
2549
+ "(1..97).to_list.ninety_six?",
2550
+ "[].ninety_six?"
2551
+ ]
2552
+ },
2553
+ "ninety_seven?" => {
2554
+ name: "ninety_seven?",
2555
+ description: "returns whether the list size is ninety seven.",
2556
+ examples: [
2557
+ "(1..97).to_list.ninety_seven?",
2558
+ "(1..98).to_list.ninety_seven?",
2559
+ "[].ninety_seven?"
2560
+ ]
2561
+ },
2562
+ "ninety_eight?" => {
2563
+ name: "ninety_eight?",
2564
+ description: "returns whether the list size is ninety eight.",
2565
+ examples: [
2566
+ "(1..98).to_list.ninety_eight?",
2567
+ "(1..99).to_list.ninety_eight?",
2568
+ "[].ninety_eight?"
2569
+ ]
2570
+ },
2571
+ "ninety_nine?" => {
2572
+ name: "ninety_nine?",
2573
+ description: "returns whether the list size is ninety nine.",
2574
+ examples: [
2575
+ "(1..99).to_list.ninety_nine?",
2576
+ "(1..100).to_list.ninety_nine?",
2577
+ "[].ninety_nine?"
2578
+ ]
2579
+ },
2580
+ "one_hundred?" => {
2581
+ name: "one_hundred?",
2582
+ description: "returns whether the list size is one hundred.",
2583
+ examples: [
2584
+ "(1..100).to_list.one_hundred?",
2585
+ "(1..101).to_list.one_hundred?",
2586
+ "[].one_hundred?"
2587
+ ]
2588
+ }
2589
+ }.freeze
2590
+ def self.function_documentation(scope)
2591
+ return INSTANCE_FUNCTIONS if scope == :instance
2592
+
2593
+ {}
2594
+ end
2595
+
6
2596
  delegate(
7
2597
  :code_many?,
8
2598
  :code_positive?,
@@ -133,15 +2723,51 @@ class Code
133
2723
  code_value = code_arguments.code_first
134
2724
 
135
2725
  case code_operator.to_s
2726
+ when "[]", "at", "get"
2727
+ sig(args) { Integer }
2728
+ code_get(code_value)
2729
+ when "fetch"
2730
+ sig(args) { Integer }
2731
+ code_fetch(code_value)
2732
+ when "values_at"
2733
+ sig(args) { Integer.repeat(1) }
2734
+ code_values_at(*code_arguments.raw)
2735
+ when "slice"
2736
+ sig(args) { [Object, Integer.maybe] }
2737
+ code_slice(*code_arguments.raw)
2738
+ when "slice!"
2739
+ sig(args) { [Object, Integer.maybe] }
2740
+ code_slice!(*code_arguments.raw)
2741
+ when "clear"
2742
+ sig(args)
2743
+ code_clear
136
2744
  when "join"
137
2745
  sig(args) { String.maybe }
138
2746
  code_join(code_value)
139
2747
  when "sort"
140
2748
  sig(args) { Function.maybe }
141
2749
  code_sort(code_value, **globals)
2750
+ when "sort!"
2751
+ sig(args) { Function.maybe }
2752
+ code_sort!(code_value, **globals)
142
2753
  when "<<", "append"
143
2754
  sig(args) { Object }
144
2755
  code_append(code_value)
2756
+ when "push"
2757
+ sig(args) { Object }
2758
+ code_push(code_value)
2759
+ when "prepend"
2760
+ sig(args) { Object }
2761
+ code_prepend(code_value)
2762
+ when "insert"
2763
+ sig(args) { [Integer, Object] }
2764
+ code_insert(*code_arguments.raw)
2765
+ when "concat"
2766
+ sig(args) { List.repeat(1) }
2767
+ code_concat(*code_arguments.raw)
2768
+ when "fill"
2769
+ sig(args) { [Object, Integer.maybe, Integer.maybe] }
2770
+ code_fill(*code_arguments.raw)
145
2771
  when "+", "plus"
146
2772
  sig(args) { List.maybe }
147
2773
  code_arguments.any? ? code_plus(code_value) : code_self
@@ -154,9 +2780,18 @@ class Code
154
2780
  when "detect"
155
2781
  sig(args) { (Function | Class).maybe }
156
2782
  code_detect(code_value, **globals)
2783
+ when "index", "find_index"
2784
+ sig(args) { (Object | Function | Class).maybe }
2785
+ code_index(code_value, **globals)
2786
+ when "right_index"
2787
+ sig(args) { (Object | Function | Class).maybe }
2788
+ code_right_index(code_value, **globals)
157
2789
  when "each"
158
2790
  sig(args) { (Function | Class).maybe }
159
2791
  code_each(code_value, **globals)
2792
+ when "each_index"
2793
+ sig(args) { Function }
2794
+ code_each_index(code_value, **globals)
160
2795
  when "first"
161
2796
  sig(args) { Integer.maybe }
162
2797
  code_first(code_value)
@@ -463,9 +3098,24 @@ class Code
463
3098
  when "shuffle"
464
3099
  sig(args)
465
3100
  code_shuffle
3101
+ when "shuffle!"
3102
+ sig(args)
3103
+ code_shuffle!
466
3104
  when "flatten"
467
3105
  sig(args) { Integer.maybe }
468
3106
  code_flatten(code_value)
3107
+ when "delete"
3108
+ sig(args) { Object }
3109
+ code_delete(code_value)
3110
+ when "delete_at"
3111
+ sig(args) { Integer }
3112
+ code_delete_at(code_value)
3113
+ when "delete_if"
3114
+ sig(args) { Function | Class }
3115
+ code_delete_if(code_value, **globals)
3116
+ when "keep_if"
3117
+ sig(args) { Function | Class }
3118
+ code_keep_if(code_value, **globals)
469
3119
  when "pop"
470
3120
  sig(args) { Integer.maybe }
471
3121
  code_pop(code_value)
@@ -475,21 +3125,48 @@ class Code
475
3125
  when "shift"
476
3126
  sig(args) { Integer.maybe }
477
3127
  code_shift(code_value)
478
- when "include?"
3128
+ when "include?", "member?"
479
3129
  sig(args) { Object }
480
3130
  code_include?(code_value)
481
3131
  when "last"
482
3132
  sig(args)
483
3133
  code_last
3134
+ when "take"
3135
+ sig(args) { Integer }
3136
+ code_take(code_value)
3137
+ when "drop"
3138
+ sig(args) { Integer }
3139
+ code_drop(code_value)
3140
+ when "drop_while"
3141
+ sig(args) { Function | Class }
3142
+ code_drop_while(code_value, **globals)
3143
+ when "take_while"
3144
+ sig(args) { Function | Class }
3145
+ code_take_while(code_value, **globals)
3146
+ when "zip"
3147
+ sig(args) { List.repeat(1) }
3148
+ code_zip(*code_arguments.raw)
484
3149
  when "map"
485
3150
  sig(args) { (Function | Class).maybe }
486
3151
  code_map(code_value, **globals)
487
3152
  when "map!"
488
3153
  sig(args) { (Function | Class).maybe }
489
3154
  code_map!(code_value, **globals)
3155
+ when "flat_map"
3156
+ sig(args) { Function | Class }
3157
+ code_flat_map(code_value, **globals)
490
3158
  when "max"
491
3159
  sig(args) { (Function | Class).maybe }
492
3160
  code_max(code_value, **globals)
3161
+ when "maximum"
3162
+ sig(args) { (Function | Class).maybe }
3163
+ code_maximum(code_value, **globals)
3164
+ when "minimum"
3165
+ sig(args) { (Function | Class).maybe }
3166
+ code_minimum(code_value, **globals)
3167
+ when "minimum_maximum"
3168
+ sig(args) { (Function | Class).maybe }
3169
+ code_minimum_maximum(code_value, **globals)
493
3170
  when "none?"
494
3171
  sig(args) { (Function | Class).maybe }
495
3172
  code_none?(code_value, **globals)
@@ -499,13 +3176,70 @@ class Code
499
3176
  when "reduce"
500
3177
  sig(args) { (Function | Class).maybe }
501
3178
  code_reduce(code_value, **globals)
3179
+ when "group"
3180
+ sig(args) { (Function | Class).maybe }
3181
+ code_group(code_value, **globals)
3182
+ when "partition"
3183
+ sig(args) { Function | Class }
3184
+ code_partition(code_value, **globals)
3185
+ when "cycle"
3186
+ sig(args) { [Integer.maybe, Function.maybe] }
3187
+ code_cycle(*code_arguments.raw, **globals)
3188
+ when "transpose"
3189
+ sig(args)
3190
+ code_transpose
3191
+ when "combination"
3192
+ sig(args) { Integer }
3193
+ code_combination(code_value)
3194
+ when "permutation"
3195
+ sig(args) { Integer.maybe }
3196
+ code_permutation(code_value)
3197
+ when "product"
3198
+ sig(args) { List.repeat(1) }
3199
+ code_product(*code_arguments.raw)
3200
+ when "repeated_combination"
3201
+ sig(args) { Integer }
3202
+ code_repeated_combination(code_value)
3203
+ when "repeated_permutation"
3204
+ sig(args) { Integer }
3205
+ code_repeated_permutation(code_value)
502
3206
  when "reverse"
503
3207
  sig(args)
504
3208
  code_reverse
505
- when "select"
3209
+ when "reverse!"
3210
+ sig(args)
3211
+ code_reverse!
3212
+ when "reverse_each"
3213
+ sig(args) { Function }
3214
+ code_reverse_each(code_value, **globals)
3215
+ when "rotate"
3216
+ sig(args) { Integer.maybe }
3217
+ code_rotate(code_value)
3218
+ when "rotate!"
3219
+ sig(args) { Integer.maybe }
3220
+ code_rotate!(code_value)
3221
+ when "union"
3222
+ sig(args) { List.repeat(1) }
3223
+ code_union(*code_arguments.raw)
3224
+ when "intersection"
3225
+ sig(args) { List.repeat(1) }
3226
+ code_intersection(*code_arguments.raw)
3227
+ when "difference"
3228
+ sig(args) { List.repeat(1) }
3229
+ code_difference(*code_arguments.raw)
3230
+ when "intersect?"
3231
+ sig(args) { List }
3232
+ code_intersect?(code_value)
3233
+ when "associate"
3234
+ sig(args) { Object }
3235
+ code_associate(code_value)
3236
+ when "right_associate"
3237
+ sig(args) { Object }
3238
+ code_right_associate(code_value)
3239
+ when "select", "filter"
506
3240
  sig(args) { (Function | Class).maybe }
507
3241
  code_select(code_value, **globals)
508
- when "select!"
3242
+ when "select!", "filter!"
509
3243
  sig(args) { (Function | Class).maybe }
510
3244
  code_select!(code_value, **globals)
511
3245
  when "compact"
@@ -520,15 +3254,36 @@ class Code
520
3254
  when "reject!"
521
3255
  sig(args) { (Function | Class).maybe }
522
3256
  code_reject!(code_value, **globals)
523
- when "size"
3257
+ when "size", "length"
524
3258
  sig(args)
525
3259
  code_size
3260
+ when "empty?"
3261
+ sig(args)
3262
+ code_empty?
3263
+ when "count"
3264
+ sig(args) { (Function | Class).maybe }
3265
+ code_count(code_value, **globals)
526
3266
  when "sum"
527
3267
  sig(args)
528
3268
  code_sum
3269
+ when "tally"
3270
+ sig(args)
3271
+ code_tally
3272
+ when "entries"
3273
+ sig(args)
3274
+ code_entries
3275
+ when "to_dictionary"
3276
+ sig(args)
3277
+ code_to_dictionary
529
3278
  when "uniq"
530
3279
  sig(args) { (Function | Class).maybe }
531
3280
  code_uniq(code_value, **globals)
3281
+ when "sort_by!"
3282
+ sig(args) { (Function | Class).maybe }
3283
+ code_sort_by!(code_value, **globals)
3284
+ when "uniq!"
3285
+ sig(args) { (Function | Class).maybe }
3286
+ code_uniq!(code_value, **globals)
532
3287
  when "many?"
533
3288
  sig(args)
534
3289
  code_many?
@@ -882,6 +3637,49 @@ class Code
882
3637
  self
883
3638
  end
884
3639
 
3640
+ def code_clear
3641
+ raw.clear
3642
+ self
3643
+ end
3644
+
3645
+ def code_push(other)
3646
+ code_append(other)
3647
+ end
3648
+
3649
+ def code_prepend(other)
3650
+ code_other = other.to_code
3651
+ raw.unshift(code_other)
3652
+ self
3653
+ end
3654
+
3655
+ def code_insert(index, value)
3656
+ code_index = index.to_code
3657
+ code_value = value.to_code
3658
+ raw.insert(code_index.raw, code_value)
3659
+ self
3660
+ end
3661
+
3662
+ def code_concat(*lists)
3663
+ lists.to_code.raw.each { |list| raw.concat(list.raw) }
3664
+ self
3665
+ end
3666
+
3667
+ def code_fill(value, start = nil, length = nil)
3668
+ code_value = value.to_code
3669
+ code_start = start.to_code
3670
+ code_length = length.to_code
3671
+
3672
+ if code_start.nothing?
3673
+ raw.fill(code_value)
3674
+ elsif code_length.nothing?
3675
+ raw.fill(code_value, code_start.raw)
3676
+ else
3677
+ raw.fill(code_value, code_start.raw, code_length.raw)
3678
+ end
3679
+
3680
+ self
3681
+ end
3682
+
885
3683
  def code_plus(other)
886
3684
  code_other = other.to_code
887
3685
 
@@ -915,6 +3713,59 @@ class Code
915
3713
  e.code_value
916
3714
  end
917
3715
 
3716
+ def code_index(argument = nil, **globals)
3717
+ code_argument = argument.to_code
3718
+
3719
+ if code_argument.nothing?
3720
+ return Nothing.new
3721
+ elsif code_argument.is_a?(Function)
3722
+ index =
3723
+ raw.index.with_index do |code_element, index|
3724
+ code_argument.call(
3725
+ arguments: List.new([code_element, Integer.new(index), self]),
3726
+ **globals
3727
+ ).truthy?
3728
+ rescue Error::Next => e
3729
+ e.code_value.truthy?
3730
+ end
3731
+ elsif code_argument.is_a?(Class)
3732
+ index = raw.index { |code_element| code_element.is_a?(code_argument.raw) }
3733
+ else
3734
+ index = raw.index(code_argument)
3735
+ end
3736
+
3737
+ index.nil? ? Nothing.new : Integer.new(index)
3738
+ rescue Error::Break => e
3739
+ e.code_value
3740
+ end
3741
+
3742
+ def code_right_index(argument = nil, **globals)
3743
+ code_argument = argument.to_code
3744
+
3745
+ if code_argument.nothing?
3746
+ return Nothing.new
3747
+ elsif code_argument.is_a?(Function)
3748
+ index =
3749
+ raw.rindex.with_index do |code_element, index|
3750
+ code_argument.call(
3751
+ arguments: List.new([code_element, Integer.new(index), self]),
3752
+ **globals
3753
+ ).truthy?
3754
+ rescue Error::Next => e
3755
+ e.code_value.truthy?
3756
+ end
3757
+ elsif code_argument.is_a?(Class)
3758
+ index =
3759
+ raw.rindex { |code_element| code_element.is_a?(code_argument.raw) }
3760
+ else
3761
+ index = raw.rindex(code_argument)
3762
+ end
3763
+
3764
+ index.nil? ? Nothing.new : Integer.new(index)
3765
+ rescue Error::Break => e
3766
+ e.code_value
3767
+ end
3768
+
918
3769
  def code_each(argument = nil, **globals)
919
3770
  code_argument = argument.to_code
920
3771
 
@@ -936,6 +3787,24 @@ class Code
936
3787
  e.code_value
937
3788
  end
938
3789
 
3790
+ def code_each_index(argument, **globals)
3791
+ code_argument = argument.to_code
3792
+
3793
+ raw.each_index do |index|
3794
+ code_index = Integer.new(index)
3795
+ code_argument.call(
3796
+ arguments: List.new([code_index, code_index, self]),
3797
+ **globals
3798
+ )
3799
+ rescue Error::Next => e
3800
+ e.code_value
3801
+ end
3802
+
3803
+ self
3804
+ rescue Error::Break => e
3805
+ e.code_value
3806
+ end
3807
+
939
3808
  def code_first(value = nil)
940
3809
  code_value = value.to_code
941
3810
 
@@ -1360,6 +4229,11 @@ class Code
1360
4229
  List.new(raw.shuffle)
1361
4230
  end
1362
4231
 
4232
+ def code_shuffle!
4233
+ raw.shuffle!
4234
+ self
4235
+ end
4236
+
1363
4237
  def code_flatten(level = nil)
1364
4238
  code_level = level.to_code
1365
4239
  code_level = Integer.new(-1) if code_level.nothing?
@@ -1380,6 +4254,58 @@ class Code
1380
4254
  )
1381
4255
  end
1382
4256
 
4257
+ def code_delete(value)
4258
+ code_value = value.to_code
4259
+ raw.delete(code_value) || Nothing.new
4260
+ end
4261
+
4262
+ def code_delete_at(index)
4263
+ code_index = index.to_code
4264
+ raw.delete_at(code_index.raw) || Nothing.new
4265
+ end
4266
+
4267
+ def code_delete_if(argument, **globals)
4268
+ code_argument = argument.to_code
4269
+
4270
+ raw.delete_if.with_index do |code_element, index|
4271
+ if code_argument.is_a?(Class)
4272
+ code_element.is_a?(code_argument.raw)
4273
+ else
4274
+ code_argument.call(
4275
+ arguments: List.new([code_element, Integer.new(index), self]),
4276
+ **globals
4277
+ ).truthy?
4278
+ end
4279
+ rescue Error::Next => e
4280
+ e.code_value.truthy?
4281
+ end
4282
+
4283
+ self
4284
+ rescue Error::Break => e
4285
+ e.code_value
4286
+ end
4287
+
4288
+ def code_keep_if(argument, **globals)
4289
+ code_argument = argument.to_code
4290
+
4291
+ raw.keep_if.with_index do |code_element, index|
4292
+ if code_argument.is_a?(Class)
4293
+ code_element.is_a?(code_argument.raw)
4294
+ else
4295
+ code_argument.call(
4296
+ arguments: List.new([code_element, Integer.new(index), self]),
4297
+ **globals
4298
+ ).truthy?
4299
+ end
4300
+ rescue Error::Next => e
4301
+ e.code_value.truthy?
4302
+ end
4303
+
4304
+ self
4305
+ rescue Error::Break => e
4306
+ e.code_value
4307
+ end
4308
+
1383
4309
  def code_pop(n = nil)
1384
4310
  code_n = n.to_code
1385
4311
  n = code_n.raw
@@ -1411,6 +4337,63 @@ class Code
1411
4337
  raw.last || Nothing.new
1412
4338
  end
1413
4339
 
4340
+ def code_take(n)
4341
+ code_n = n.to_code
4342
+ List.new(raw.take(code_n.raw))
4343
+ end
4344
+
4345
+ def code_drop(n)
4346
+ code_n = n.to_code
4347
+ List.new(raw.drop(code_n.raw))
4348
+ end
4349
+
4350
+ def code_drop_while(argument, **globals)
4351
+ code_argument = argument.to_code
4352
+
4353
+ List.new(
4354
+ raw.drop_while.with_index do |code_element, index|
4355
+ if code_argument.is_a?(Class)
4356
+ code_element.is_a?(code_argument.raw)
4357
+ else
4358
+ code_argument.call(
4359
+ arguments: List.new([code_element, Integer.new(index), self]),
4360
+ **globals
4361
+ ).truthy?
4362
+ end
4363
+ rescue Error::Next => e
4364
+ e.code_value.truthy?
4365
+ end
4366
+ )
4367
+ rescue Error::Break => e
4368
+ e.code_value
4369
+ end
4370
+
4371
+ def code_take_while(argument, **globals)
4372
+ code_argument = argument.to_code
4373
+
4374
+ List.new(
4375
+ raw.take_while.with_index do |code_element, index|
4376
+ if code_argument.is_a?(Class)
4377
+ code_element.is_a?(code_argument.raw)
4378
+ else
4379
+ code_argument.call(
4380
+ arguments: List.new([code_element, Integer.new(index), self]),
4381
+ **globals
4382
+ ).truthy?
4383
+ end
4384
+ rescue Error::Next => e
4385
+ e.code_value.truthy?
4386
+ end
4387
+ )
4388
+ rescue Error::Break => e
4389
+ e.code_value
4390
+ end
4391
+
4392
+ def code_zip(*arguments)
4393
+ code_arguments = arguments.to_code
4394
+ List.new(raw.zip(*code_arguments.raw.map(&:raw)))
4395
+ end
4396
+
1414
4397
  def code_map(argument = nil, **globals)
1415
4398
  code_argument = argument.to_code
1416
4399
 
@@ -1457,6 +4440,32 @@ class Code
1457
4440
  e.code_value
1458
4441
  end
1459
4442
 
4443
+ def code_flat_map(argument = nil, **globals)
4444
+ code_argument = argument.to_code
4445
+
4446
+ List.new(
4447
+ raw.flat_map.with_index do |code_element, index|
4448
+ result =
4449
+ if code_argument.is_a?(Function)
4450
+ code_argument.call(
4451
+ arguments: List.new([code_element, Integer.new(index), self]),
4452
+ **globals
4453
+ )
4454
+ elsif code_argument.is_a?(Class)
4455
+ code_argument.raw.new(code_element)
4456
+ else
4457
+ Nothing.new
4458
+ end
4459
+
4460
+ result.is_a?(List) ? result.raw : result
4461
+ rescue Error::Next => e
4462
+ e.code_value.is_a?(List) ? e.code_value.raw : e.code_value
4463
+ end
4464
+ )
4465
+ rescue Error::Break => e
4466
+ e.code_value
4467
+ end
4468
+
1460
4469
  def code_max(argument = nil, **globals)
1461
4470
  code_argument = argument.to_code
1462
4471
 
@@ -1476,6 +4485,51 @@ class Code
1476
4485
  e.code_value
1477
4486
  end
1478
4487
 
4488
+ def code_maximum(argument = nil, **globals)
4489
+ code_max(argument, **globals)
4490
+ end
4491
+
4492
+ def code_minimum(argument = nil, **globals)
4493
+ code_argument = argument.to_code
4494
+
4495
+ raw.min_by.with_index do |code_element, index|
4496
+ if code_argument.is_a?(Function)
4497
+ code_argument.call(
4498
+ arguments: List.new([code_element, Integer.new(index), self]),
4499
+ **globals
4500
+ )
4501
+ else
4502
+ code_element
4503
+ end
4504
+ rescue Error::Next => e
4505
+ e.code_value
4506
+ end || Nothing.new
4507
+ rescue Error::Break => e
4508
+ e.code_value
4509
+ end
4510
+
4511
+ def code_minimum_maximum(argument = nil, **globals)
4512
+ code_argument = argument.to_code
4513
+
4514
+ values =
4515
+ raw.minmax_by.with_index do |code_element, index|
4516
+ if code_argument.is_a?(Function)
4517
+ code_argument.call(
4518
+ arguments: List.new([code_element, Integer.new(index), self]),
4519
+ **globals
4520
+ )
4521
+ else
4522
+ code_element
4523
+ end
4524
+ rescue Error::Next => e
4525
+ e.code_value
4526
+ end
4527
+
4528
+ List.new(values)
4529
+ rescue Error::Break => e
4530
+ e.code_value
4531
+ end
4532
+
1479
4533
  def code_none?(argument = nil, **globals)
1480
4534
  code_argument = argument.to_code
1481
4535
 
@@ -1556,10 +4610,207 @@ class Code
1556
4610
  e.code_value
1557
4611
  end
1558
4612
 
4613
+ def code_group(argument = nil, **globals)
4614
+ code_argument = argument.to_code
4615
+
4616
+ grouped =
4617
+ raw.group_by.with_index do |code_element, index|
4618
+ if code_argument.is_a?(Function)
4619
+ code_argument.call(
4620
+ arguments: List.new([code_element, Integer.new(index), self]),
4621
+ **globals
4622
+ )
4623
+ elsif code_argument.is_a?(Class)
4624
+ Boolean.new(code_element.is_a?(code_argument.raw))
4625
+ else
4626
+ code_element
4627
+ end
4628
+ rescue Error::Next => e
4629
+ e.code_value
4630
+ end
4631
+
4632
+ Dictionary.new(grouped.transform_values { |values| List.new(values) })
4633
+ rescue Error::Break => e
4634
+ e.code_value
4635
+ end
4636
+
4637
+ def code_partition(argument, **globals)
4638
+ code_argument = argument.to_code
4639
+
4640
+ lists =
4641
+ raw.partition.with_index do |code_element, index|
4642
+ if code_argument.is_a?(Function)
4643
+ code_argument.call(
4644
+ arguments: List.new([code_element, Integer.new(index), self]),
4645
+ **globals
4646
+ ).truthy?
4647
+ elsif code_argument.is_a?(Class)
4648
+ code_element.is_a?(code_argument.raw)
4649
+ else
4650
+ false
4651
+ end
4652
+ rescue Error::Next => e
4653
+ e.code_value.truthy?
4654
+ end
4655
+
4656
+ List.new(lists.map { |list| List.new(list) })
4657
+ rescue Error::Break => e
4658
+ e.code_value
4659
+ end
4660
+
4661
+ def code_cycle(times = nil, function = nil, **globals)
4662
+ code_times = times.to_code
4663
+ code_function = function.to_code
4664
+
4665
+ if code_times.is_a?(Function)
4666
+ code_function = code_times
4667
+ code_times = Integer.new(1)
4668
+ elsif code_times.nothing?
4669
+ code_times = Integer.new(1)
4670
+ end
4671
+
4672
+ cycled = raw.cycle(code_times.raw)
4673
+
4674
+ if code_function.is_a?(Function)
4675
+ cycled.each.with_index do |code_element, index|
4676
+ code_function.call(
4677
+ arguments: List.new([code_element, Integer.new(index), self]),
4678
+ **globals
4679
+ )
4680
+ rescue Error::Next => e
4681
+ e.code_value
4682
+ end
4683
+
4684
+ self
4685
+ else
4686
+ List.new(cycled.to_a)
4687
+ end
4688
+ rescue Error::Break => e
4689
+ e.code_value
4690
+ end
4691
+
4692
+ def code_transpose
4693
+ List.new(raw.map(&:raw).transpose)
4694
+ end
4695
+
4696
+ def code_combination(size)
4697
+ code_size = size.to_code
4698
+ List.new(raw.combination(code_size.raw).map { |values| List.new(values) })
4699
+ end
4700
+
4701
+ def code_permutation(size = nil)
4702
+ code_size = size.to_code
4703
+ size = code_size.nothing? ? raw.size : code_size.raw
4704
+
4705
+ List.new(raw.permutation(size).map { |values| List.new(values) })
4706
+ end
4707
+
4708
+ def code_product(*lists)
4709
+ code_lists = lists.to_code
4710
+
4711
+ List.new(
4712
+ raw
4713
+ .product(*code_lists.raw.map(&:raw))
4714
+ .map { |values| List.new(values) }
4715
+ )
4716
+ end
4717
+
4718
+ def code_repeated_combination(size)
4719
+ code_size = size.to_code
4720
+
4721
+ List.new(
4722
+ raw
4723
+ .repeated_combination(code_size.raw)
4724
+ .map { |values| List.new(values) }
4725
+ )
4726
+ end
4727
+
4728
+ def code_repeated_permutation(size)
4729
+ code_size = size.to_code
4730
+
4731
+ List.new(
4732
+ raw
4733
+ .repeated_permutation(code_size.raw)
4734
+ .map { |values| List.new(values) }
4735
+ )
4736
+ end
4737
+
1559
4738
  def code_reverse
1560
4739
  List.new(raw.reverse)
1561
4740
  end
1562
4741
 
4742
+ def code_reverse!
4743
+ raw.reverse!
4744
+ self
4745
+ end
4746
+
4747
+ def code_reverse_each(argument, **globals)
4748
+ code_argument = argument.to_code
4749
+
4750
+ raw.reverse_each.with_index do |code_element, index|
4751
+ code_argument.call(
4752
+ arguments: List.new([code_element, Integer.new(index), self]),
4753
+ **globals
4754
+ )
4755
+ rescue Error::Next => e
4756
+ e.code_value
4757
+ end
4758
+
4759
+ self
4760
+ rescue Error::Break => e
4761
+ e.code_value
4762
+ end
4763
+
4764
+ def code_rotate(count = nil)
4765
+ code_count = count.to_code
4766
+ code_count = Integer.new(1) if code_count.nothing?
4767
+
4768
+ List.new(raw.rotate(code_count.raw))
4769
+ end
4770
+
4771
+ def code_rotate!(count = nil)
4772
+ self.raw = code_rotate(count).raw
4773
+ self
4774
+ end
4775
+
4776
+ def code_union(*lists)
4777
+ List.new(raw.union(*lists.to_code.raw.map(&:raw)))
4778
+ end
4779
+
4780
+ def code_intersection(*lists)
4781
+ List.new(raw.intersection(*lists.to_code.raw.map(&:raw)))
4782
+ end
4783
+
4784
+ def code_difference(*lists)
4785
+ List.new(raw.difference(*lists.to_code.raw.map(&:raw)))
4786
+ end
4787
+
4788
+ def code_intersect?(list)
4789
+ code_list = list.to_code
4790
+
4791
+ Boolean.new(raw.intersect?(code_list.raw))
4792
+ end
4793
+
4794
+ def code_associate(value)
4795
+ code_value = value.to_code
4796
+ pair =
4797
+ raw.detect do |element|
4798
+ element.is_a?(List) && element.raw.first == code_value
4799
+ end
4800
+
4801
+ pair || Nothing.new
4802
+ end
4803
+
4804
+ def code_right_associate(value)
4805
+ code_value = value.to_code
4806
+ pair =
4807
+ raw.detect do |element|
4808
+ element.is_a?(List) && element.raw.second == code_value
4809
+ end
4810
+
4811
+ pair || Nothing.new
4812
+ end
4813
+
1563
4814
  def code_compact(argument = nil, **globals)
1564
4815
  code_argument = argument.to_code
1565
4816
 
@@ -1729,10 +4980,58 @@ class Code
1729
4980
  e.code_value
1730
4981
  end
1731
4982
 
4983
+ def code_sort!(argument = nil, **globals)
4984
+ self.raw = code_sort(argument, **globals).raw
4985
+ self
4986
+ end
4987
+
4988
+ def code_sort_by!(argument = nil, **globals)
4989
+ code_sort!(argument, **globals)
4990
+ end
4991
+
1732
4992
  def code_size
1733
4993
  Integer.new(raw.size)
1734
4994
  end
1735
4995
 
4996
+ def code_empty?
4997
+ Boolean.new(raw.empty?)
4998
+ end
4999
+
5000
+ def code_count(argument = nil, **globals)
5001
+ code_argument = argument.to_code
5002
+
5003
+ if code_argument.nothing?
5004
+ return Integer.new(raw.count)
5005
+ elsif code_argument.is_a?(Class)
5006
+ return Integer.new(raw.count { |element| element.is_a?(code_argument.raw) })
5007
+ end
5008
+
5009
+ index = 0
5010
+ Integer.new(
5011
+ raw.count do |code_element|
5012
+ code_argument
5013
+ .call(
5014
+ arguments: List.new([code_element, Integer.new(index), self]),
5015
+ **globals
5016
+ )
5017
+ .truthy?
5018
+ .tap { index += 1 }
5019
+ rescue Error::Next => e
5020
+ e.code_value.truthy?.tap { index += 1 }
5021
+ end
5022
+ )
5023
+ rescue Error::Break => e
5024
+ e.code_value
5025
+ end
5026
+
5027
+ def code_tally
5028
+ Dictionary.new(raw.tally)
5029
+ end
5030
+
5031
+ def code_entries
5032
+ List.new(raw)
5033
+ end
5034
+
1736
5035
  def code_uniq(argument = nil, **globals)
1737
5036
  code_argument = argument.to_code
1738
5037
 
@@ -1766,12 +5065,23 @@ class Code
1766
5065
  e.code_value
1767
5066
  end
1768
5067
 
5068
+ def code_uniq!(argument = nil, **globals)
5069
+ self.raw = code_uniq(argument, **globals).raw
5070
+ self
5071
+ end
5072
+
1769
5073
  def code_sum
1770
5074
  raw.inject(&:code_plus) || Nothing.new
1771
5075
  end
1772
5076
 
1773
- def code_deep_duplicate
1774
- List.new(raw.dup.map(&:code_deep_duplicate))
5077
+ def code_deep_duplicate(seen = {})
5078
+ seen.compare_by_identity unless seen.compare_by_identity?
5079
+ return seen[self] if seen.key?(self)
5080
+
5081
+ duplicate = List.new
5082
+ seen[self] = duplicate
5083
+ duplicate.raw.concat(raw.map { |value| value.code_deep_duplicate(seen) })
5084
+ duplicate
1775
5085
  end
1776
5086
 
1777
5087
  def code_get(argument)
@@ -1780,17 +5090,80 @@ class Code
1780
5090
  raw[code_argument.raw] || Nothing.new
1781
5091
  end
1782
5092
 
5093
+ def code_values_at(*indices)
5094
+ code_indices = indices.to_code
5095
+
5096
+ List.new(raw.values_at(*code_indices.raw.map(&:raw)))
5097
+ end
5098
+
5099
+ def code_slice(*arguments)
5100
+ code_arguments = arguments.to_code.raw
5101
+
5102
+ if code_arguments.first.is_a?(Range)
5103
+ range = code_arguments.first
5104
+ value =
5105
+ raw.slice(
5106
+ ::Range.new(
5107
+ range.code_left.to_i,
5108
+ range.code_right.to_i,
5109
+ range.exclude_end?
5110
+ )
5111
+ )
5112
+
5113
+ return value.is_a?(::Array) ? List.new(value) : value.to_code
5114
+ end
5115
+
5116
+ value = raw.slice(*code_arguments.map(&:raw))
5117
+ value.is_a?(::Array) ? List.new(value) : value.to_code
5118
+ end
5119
+
5120
+ def code_slice!(*arguments)
5121
+ code_arguments = arguments.to_code.raw
5122
+
5123
+ if code_arguments.first.is_a?(Range)
5124
+ range = code_arguments.first
5125
+ value =
5126
+ raw.slice!(
5127
+ ::Range.new(
5128
+ range.code_left.to_i,
5129
+ range.code_right.to_i,
5130
+ range.exclude_end?
5131
+ )
5132
+ )
5133
+
5134
+ return value.is_a?(::Array) ? List.new(value) : value.to_code
5135
+ end
5136
+
5137
+ value = raw.slice!(*code_arguments.map(&:raw))
5138
+ value.is_a?(::Array) ? List.new(value) : value.to_code
5139
+ end
5140
+
1783
5141
  def code_set(key, value)
1784
- code_key = key.to_code.code_to_integer
5142
+ code_key = key.to_code
5143
+ return super unless code_key.is_a?(Integer)
5144
+
1785
5145
  code_value = value.to_code
1786
- raw[code_key.raw] = code_value
5146
+ raw[code_key.code_to_integer.raw] = code_value
1787
5147
  code_value
1788
5148
  end
1789
5149
 
1790
5150
  def code_fetch(key)
1791
- code_key = key.to_code.code_to_integer
5151
+ code_key = key.to_code
5152
+ return super unless code_key.is_a?(Integer)
1792
5153
 
1793
- raw.fetch(code_key.raw, Nothing.new)
5154
+ raw.fetch(code_key.code_to_integer.raw, Nothing.new)
5155
+ end
5156
+
5157
+ def code_to_dictionary
5158
+ Dictionary.new(
5159
+ raw.map.with_index.to_h do |element, index|
5160
+ if element.is_a?(List) && element.raw.many?
5161
+ [element.raw.first, element.raw.second]
5162
+ else
5163
+ [Integer.new(index), element]
5164
+ end
5165
+ end
5166
+ )
1794
5167
  end
1795
5168
 
1796
5169
  def any?