Handbook
Glossary
byte-reverse ( n signed? -- quot )
Vocabulary
endian
.
private
Inputs
n
an
object
signed?
an
object
Outputs
quot
an
object
Definition
USING:
combinators
generalizations
kernel
math
sequences
;
IN:
endian.private
MACRO:
byte-reverse
( n signed? -- quot )
[
drop
[
dup
<iota>
[
[
1
+
-
-8
*
]
[
nip
8
*
]
2bi
[
[
shift
255
bitand
]
curry
]
dip
[
shift
]
curry
compose
]
with
map
]
[
1
-
[
bitor
]
n*quot
]
bi
]
[
[
convert-signed-quot
]
[
drop
[
]
]
if
]
2bi
[
[
[
cleave
]
curry
]
dip
compose
]
dip
compose
;