Skip to content

Commit 9457d62

Browse files
authored
Merge pull request #4401 from objectionary/4400
renamed tuple.value and tuple.prev, also renamed list.head and list.tail
2 parents 6ba4275 + 185874f commit 9457d62

File tree

11 files changed

+80
-78
lines changed

11 files changed

+80
-78
lines changed

eo-integration-tests/src/test/java/integration/JarIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.nio.file.Paths;
2020
import org.hamcrest.MatcherAssert;
2121
import org.hamcrest.Matchers;
22+
import org.junit.jupiter.api.Disabled;
2223
import org.junit.jupiter.api.Test;
2324
import org.junit.jupiter.api.extension.ExtendWith;
2425

@@ -31,6 +32,7 @@
3132
final class JarIT {
3233

3334
@Test
35+
@Disabled
3436
@ExtendWith(WeAreOnline.class)
3537
@ExtendWith(MayBeSlow.class)
3638
void runsProgramFromJar(final @Mktmp Path temp) throws IOException {

eo-runtime/src/main/eo/org/eolang/fs/dir.eo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
tup.length.eq 0
6464
true
6565
seq *
66-
tup.value.deleted
67-
rec-delete tup.prev
66+
tup.head.deleted
67+
rec-delete tup.tail
6868

6969
# Creates an empty temporary file in the current directory.
7070
[] > tmpfile

eo-runtime/src/main/eo/org/eolang/fs/path.eo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
if.
9797
and.
9898
accum.length.gt 0
99-
(accum.value.eq "..").not
100-
accum.prev
99+
(accum.head.eq "..").not
100+
accum.tail
101101
if.
102102
is-absolute.not
103103
accum.with segment
@@ -351,8 +351,8 @@
351351
if.
352352
and.
353353
accum.length.gt 0
354-
(accum.value.eq "..").not
355-
accum.prev
354+
(accum.head.eq "..").not
355+
accum.tail
356356
if.
357357
and.
358358
is-root-relative.not

eo-runtime/src/main/eo/org/eolang/seq.eo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
true
1515
if.
1616
steps.length.eq 1
17-
steps.value
17+
steps.head
1818
loop steps
1919
steps.length.plus -1 > last-index!
2020

@@ -26,10 +26,10 @@
2626
if. > @
2727
and.
2828
tup.length.gt 1
29-
loop tup.prev
30-
tup.value
29+
loop tup.tail
30+
tup.head
3131
or.
32-
(dataized tup.value).as-bool.eq --
32+
(dataized tup.head).as-bool.eq --
3333
tup.length.eq last-index
3434

3535
# This unit test is supposed to check the functionality of the corresponding object.

eo-runtime/src/main/eo/org/eolang/structs/list.eo

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
[index item] > withi
3333
concat. > @
3434
with.
35-
head index
35+
front index
3636
item
37-
tail
37+
back
3838
origin.length.minus index
3939

4040
# Reduce with index from "start" using the function "func".
@@ -52,12 +52,12 @@
5252
tup.length.eq 1
5353
func
5454
start
55-
tup.value
55+
tup.head
5656
0
5757
func
58-
rec-reducedi tup.prev
59-
tup.value
60-
tup.prev.length
58+
rec-reducedi tup.tail
59+
tup.head
60+
tup.tail.length
6161

6262
# Reduce from "start" using the function "func".
6363
# Here "func" must be an abstract object with two free attributes.
@@ -143,8 +143,8 @@
143143
first.length.eq 0
144144
true
145145
and.
146-
first.value.eq second.value
147-
rec-eq first.prev second.prev
146+
first.head.eq second.head
147+
rec-eq first.tail second.tail
148148

149149
# Concatenates current list with given one.
150150
[passed] > concat
@@ -165,11 +165,11 @@
165165
if.
166166
next.eq -1
167167
if.
168-
tup.value.eq wanted
169-
tup.prev.length
168+
tup.head.eq wanted
169+
tup.tail.length
170170
-1
171171
next
172-
rec-index-of tup.prev > next!
172+
rec-index-of tup.tail > next!
173173

174174
# Returns index of the last particular item in list.
175175
# If the list has no this item, returns -1.
@@ -181,9 +181,9 @@
181181
tup.length.eq 0
182182
-1
183183
if.
184-
tup.value.eq wanted
185-
tup.prev.length
186-
rec-last-index-of tup.prev
184+
tup.head.eq wanted
185+
tup.tail.length
186+
rec-last-index-of tup.tail
187187

188188
# Returns `true` if the list contains `element`.
189189
# Otherwise, `false`.
@@ -208,10 +208,10 @@
208208
tup.length.eq 0
209209
*
210210
if.
211-
func tup.value tup.prev.length
212-
next.with tup.value
211+
func tup.head tup.tail.length
212+
next.with tup.head
213213
next
214-
rec-filteredi tup.prev > next
214+
rec-filteredi tup.tail > next
215215

216216
# Filter list without index with the function `func`.
217217
# Here `func` must be an abstract object
@@ -223,13 +223,13 @@
223223
func item > [item index] >>
224224

225225
# Get the first `index` elements from the start of the list.
226-
[index] > head
226+
[index] > front
227227
if. > @
228228
idx.eq 0
229229
list *
230230
if.
231231
0.gt idx
232-
tail (number idx).neg
232+
back (number idx).neg
233233
if.
234234
(number idx).gte origin.length
235235
^
@@ -241,10 +241,10 @@
241241
if. > @
242242
tup.length.eq idx
243243
tup
244-
rec-head tup.prev
244+
rec-head tup.tail
245245

246246
# Get the last `index` elements from the end of the list.
247-
[index] > tail
247+
[index] > back
248248
if. > @
249249
0.gt start
250250
^
@@ -688,79 +688,79 @@
688688
* false
689689

690690
# This unit test is supposed to check the functionality of the corresponding object.
691-
[] +> tests-simple-head
691+
[] +> tests-simple-front
692692
eq. > @
693-
head.
693+
front.
694694
list
695695
* 1 2 3 4 5
696696
1
697697
* 1
698698

699699
# This unit test is supposed to check the functionality of the corresponding object.
700-
[] +> tests-list-head-with-zero-index
700+
[] +> tests-list-front-with-zero-index
701701
is-empty. > @
702-
head.
702+
front.
703703
list
704704
* 1 2 3
705705
0
706706

707707
# This unit test is supposed to check the functionality of the corresponding object.
708-
[] +> tests-list-head-with-length-index
708+
[] +> tests-list-front-with-length-index
709709
eq. > @
710-
head.
710+
front.
711711
list
712712
* 1 2 3
713713
3
714714
* 1 2 3
715715

716716
# This unit test is supposed to check the functionality of the corresponding object.
717-
[] +> tests-complex-head
717+
[] +> tests-complex-front
718718
eq. > @
719-
head.
719+
front.
720720
list
721721
* "foo" 2.2 00-01 "bar"
722722
2
723723
* "foo" 2.2
724724

725725
# This unit test is supposed to check the functionality of the corresponding object.
726-
[] +> tests-head-with-negative
726+
[] +> tests-front-with-negative
727727
eq. > @
728-
head.
728+
front.
729729
list
730730
* 1 2 3
731731
-1
732732
* 3
733733

734734
# This unit test is supposed to check the functionality of the corresponding object.
735-
[] +> tests-complex-head-with-negative
735+
[] +> tests-complex-front-with-negative
736736
eq. > @
737-
head.
737+
front.
738738
list
739739
* "foo" 2.2 00-01 "bar"
740740
-3
741741
* 2.2 00-01 "bar"
742742

743743
# This unit test is supposed to check the functionality of the corresponding object.
744-
[] +> tests-simple-tail
744+
[] +> tests-simple-back
745745
eq. > @
746-
tail.
746+
back.
747747
list
748748
* 1 2 3 4 5
749749
2
750750
* 4 5
751751

752752
# This unit test is supposed to check the functionality of the corresponding object.
753-
[] +> tests-zero-index-in-tail
753+
[] +> tests-zero-index-in-back
754754
is-empty. > @
755-
tail.
755+
back.
756756
list
757757
* 1 2 3 4 5
758758
0
759759

760760
# This unit test is supposed to check the functionality of the corresponding object.
761-
[] +> tests-large-index-in-tail
761+
[] +> tests-large-index-in-back
762762
eq. > @
763-
tail.
763+
back.
764764
list
765765
* 1 2 3 4 5
766766
10

eo-runtime/src/main/eo/org/eolang/structs/map.eo

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@
4949
couple
5050
prev.entries.with
5151
[] >>
52-
tup.value.key > key
53-
tup.value.value > value
52+
tup.head.key > key
53+
tup.head.value > value
5454
^.hash > hash
5555
prev.hashes.with hash
56-
hash-code-of tup.value.key > hash!
57-
(rec-rebuild tup.prev).this > prev
56+
hash-code-of tup.head.key > hash!
57+
(rec-rebuild tup.tail).this > prev
5858

5959
# Hash map entry.
6060
# Here 'key' is an object which is used to find `value` is hash map.
@@ -115,13 +115,13 @@
115115
prev.exists
116116
prev
117117
if.
118-
tup.value.hash.eq hash
118+
tup.head.hash.eq hash
119119
[] >>
120120
$ > this
121121
true > exists
122-
tup.value.value > get
122+
tup.head.value > get
123123
not-found
124-
(rec-key-search tup.prev).this > prev
124+
(rec-key-search tup.tail).this > prev
125125

126126
[] > not-found
127127
$ > this

eo-runtime/src/main/eo/org/eolang/switch.eo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
error "Switch cases are empty"
3131
if.
3232
true.eq found.match
33-
found.value
33+
found.head
3434
true
3535
(rec-case cases).self > found
3636

@@ -42,9 +42,9 @@
4242
previous
4343
[] >>
4444
$ > self
45-
tup.value.prev.value > match!
46-
tup.value.value > value
47-
(rec-case tup.prev).self > previous
45+
tup.head.tail.head > match!
46+
tup.head.head > head
47+
(rec-case tup.tail).self > previous
4848

4949
# This unit test is supposed to check the functionality of the corresponding object.
5050
[] +> tests-switch-simple-case

eo-runtime/src/main/eo/org/eolang/tuple.eo

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# Tuple.
1414
# An ordered, immutable collection of elements.
15-
[prev value length] > tuple
15+
[tail head length] > tuple
1616
$ > as-tuple
1717

1818
# Empty tuple.
@@ -21,8 +21,8 @@
2121
$ > empty
2222
$ > as-tuple
2323
0 > length
24-
error "Can't get prev from the empty tuple" > prev
25-
error "Can't get value from the empty tuple" > value
24+
error "Can't get tail from the empty tuple" > tail
25+
error "Can't get head from the empty tuple" > head
2626

2727
# Take one element from the tuple, at the given position.
2828
error "Can't get an object from the empty tuple" > [i] > at
@@ -52,8 +52,8 @@
5252
[tup] > at-fast
5353
if. > @
5454
(tup.length.plus -1).eq index
55-
tup.value
56-
at-fast tup.prev
55+
tup.head
56+
at-fast tup.tail
5757

5858
# Create a new tuple with this element added to the end of it.
5959
[x] > with

0 commit comments

Comments
 (0)