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
_
shift
]
]
with
map
]
[
1
-
[
bitor
]
n*quot
]
bi
]
[
[
convert-signed-quot
]
[
drop
[
]
]
if
]
2bi
'[
_
cleave
@
@
]
;