File tree Expand file tree Collapse file tree 6 files changed +36
-26
lines changed
eo-runtime/src/main/eo/org/eolang Expand file tree Collapse file tree 6 files changed +36
-26
lines changed Original file line number Diff line number Diff line change 22+alias org.eolang.ss.reducedi
33+alias org.eolang.ss.reduced
44+alias org.eolang.ss.eachi
5- +alias org.eolang.ss.mappedi
65+alias org.eolang.tt.sprintf
76+architect yegor256@gmail.com
87+home https://github.com/objectionary/eo
4948 back
5049 origin.length.minus index
5150
52- # Map without index. Here "func" must be an abstract
53- # object with one free attribute, for the element
54- # of the collection.
55- [func] > mapped
56- mappedi > @
57- ^
58- func item > [item idx] >>
59-
6051 # For each collection element dataize the object
6152 # Here "func" must be an abstract object with
6253 # one free attribute, the element of the collection.
331322 * 4 0
332323 * 7 3
333324
334- # Tests that mapping without index transforms elements correctly.
335- [] +> tests-simple-list-mapping
336- eq. > @
337- mapped.
338- list
339- * 1 2 3
340- x.times 2 > [x]
341- * 2 4 6
342-
343325 # Tests that iterating over elements without index access works correctly.
344326 [] +> tests-iterates-with-each
345327 eq. > @
Original file line number Diff line number Diff line change 11+alias org.eolang.ss.hash-code-of
22+alias org.eolang.ss.list
3+ +alias org.eolang.ss.mapped
34+alias org.eolang.tt.sprintf
45+architect yegor256@gmail.com
56+home https://github.com/objectionary/eo
6566 entries.length > size
6667 # Returns `list` of all keys in hash map.
6768 # Keys order is not guaranteed.
68- mapped. > keys
69+ mapped > keys
6970 list entries
7071 entry.key > [entry]
7172 # Returns `list` of all values in hash map.
7273 # Values order is not guaranteed.
73- mapped. > values
74+ mapped > values
7475 list entries
7576 entry.value > [entry]
7677
Original file line number Diff line number Diff line change 1+ +alias org.eolang.ss.list
2+ +alias org.eolang.ss.mappedi
3+ +architect yegor256@gmail.com
4+ +home https://github.com/objectionary/eo
5+ +package org.eolang.ss
6+ +version 0.0.0
7+ +spdx SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
8+ +spdx SPDX-License-Identifier: MIT
9+
10+ # Map `lst` without index. Here "func" must be an abstract
11+ # object with one free attribute, for the element
12+ # of the collection.
13+ [lst func] > mapped
14+ mappedi > @
15+ lst
16+ func item > [item idx] >>
17+
18+ # Tests that mapping without index transforms elements correctly.
19+ [] +> tests-simple-list-mapping
20+ eq. > @
21+ mapped
22+ list
23+ * 1 2 3
24+ x.times 2 > [x]
25+ * 2 4 6
Original file line number Diff line number Diff line change 11+alias org.eolang.ss.list
22+alias org.eolang.ss.map
3+ +alias org.eolang.ss.mapped
34+architect yegor256@gmail.com
45+home https://github.com/objectionary/eo
56+package org.eolang.ss
1314[lst] > set
1415 initialized > @
1516 map
16- list
17- lst
18- .mapped
17+ mapped
18+ list
19+ lst
1920 map.entry item true > [item]
20- .origin
2121
2222 # Initialized set with rebuilt unique sequence.
2323 [mp] > initialized
Original file line number Diff line number Diff line change 11+alias org.eolang.tt.contains
22+alias org.eolang.ss.list
33+alias org.eolang.ss.reduced
4+ +alias org.eolang.ss.mapped
45+architect yegor256@gmail.com
56+home https://github.com/objectionary/eo
67+package org.eolang.tt
1112# Checks if `text` contains all elements from `substrings`
1213[text substrings] > contains-all
1314 reduced > @
14- mapped.
15+ mapped
1516 substrings
1617 contains text-bts x > [x] >>
1718 true
Original file line number Diff line number Diff line change 11+alias org.eolang.tt.contains
22+alias org.eolang.ss.list
33+alias org.eolang.ss.reduced
4+ +alias org.eolang.ss.mapped
45+architect yegor256@gmail.com
56+home https://github.com/objectionary/eo
67+package org.eolang.tt
1112# Checks if `text` contains any element from `substrings`
1213[text substrings] > contains-any
1314 reduced > @
14- mapped.
15+ mapped
1516 substrings
1617 contains text-bts x > [x] >>
1718 false
You can’t perform that action at this time.
0 commit comments