Handbook
Glossary
reversed
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Reshaping sequences
Prev:
reverse ( seq -- newseq )
Next:
<reversed> ( seq -- reversed )
Vocabulary
sequences
Class description
A virtual sequence which presents a reversed view of an underlying sequence. New instances can be created by calling
<reversed>
.
Definition
IN:
sequences
TUPLE:
reversed
<
sequence-view
;
Methods
USING:
kernel
sequences
;
M:
reversed
equal?
over
reversed?
[
sequence=
]
[
2drop
f
]
if
;
USING:
kernel
math
sequences
;
M:
reversed
hashcode*
[
sequence-hashcode
]
recursive-hashcode
;
USING:
accessors
sequences
;
M:
reversed
maximum
seq>>
maximum
;
inline
USING:
accessors
sequences
;
M:
reversed
minimum
seq>>
minimum
;
inline
USING:
accessors
kernel
math
sequences
;
M:
reversed
virtual@
seq>>
[
length
swap
-
1
-
]
keep
;
inline