remove lib usage, update docs
parent
b8f8d1f159
commit
3ee55eb341
|
@ -1,12 +1,22 @@
|
||||||
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: help.markup help.syntax kernel ;
|
USING: help.markup help.syntax kernel ;
|
||||||
IN: hexdump
|
IN: hexdump
|
||||||
|
|
||||||
HELP: hexdump.
|
HELP: hexdump.
|
||||||
{ $values { "seq" "a sequence" } }
|
{ $values { "sequence" "a sequence" } }
|
||||||
{ $description "Converts a sequence to its hexadecimal and ASCII representation sixteen characters at a time and writes it to standard out." } ;
|
{ $description "Converts a sequence to its hexadecimal and ASCII representation sixteen characters at a time and writes it to standard out." } ;
|
||||||
|
|
||||||
HELP: hexdump
|
HELP: hexdump
|
||||||
{ $values { "seq" "a sequence" } { "str" "a string" } }
|
{ $values { "sequence" "a sequence" } { "string" "a string" } }
|
||||||
{ $description "Converts a sequence to its hexadecimal and ASCII representation sixteen characters at a time. Lines are separated by a newline character." }
|
{ $description "Converts a sequence to its hexadecimal and ASCII representation sixteen characters at a time. Lines are separated by a newline character." }
|
||||||
{ $see-also hexdump. } ;
|
{ $see-also hexdump. } ;
|
||||||
|
|
||||||
|
ARTICLE: "hexdump" "Hexdump"
|
||||||
|
"The " { $vocab-link "hexdump" } " vocabulary provides a traditional hexdump view of a sequence." $nl
|
||||||
|
"Write hexdump to string:"
|
||||||
|
{ $subsection hexdump }
|
||||||
|
"Write the hexdump to the output stream:"
|
||||||
|
{ $subsection hexdump. } ;
|
||||||
|
|
||||||
|
ABOUT: "hexdump"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
USING: arrays io io.streams.string kernel math math.parser namespaces
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
prettyprint sequences sequences.lib splitting grouping strings ascii ;
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: arrays io io.streams.string kernel math math.parser
|
||||||
|
namespaces prettyprint sequences splitting grouping strings
|
||||||
|
ascii ;
|
||||||
IN: hexdump
|
IN: hexdump
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
@ -21,11 +24,12 @@ IN: hexdump
|
||||||
nl ;
|
nl ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
: hexdump ( seq -- str )
|
|
||||||
|
: hexdump ( sequence -- string )
|
||||||
[
|
[
|
||||||
dup length header.
|
dup length header.
|
||||||
16 <sliced-groups> [ line. ] each-index
|
16 <sliced-groups> [ line. ] each-index
|
||||||
] with-string-writer ;
|
] with-string-writer ;
|
||||||
|
|
||||||
: hexdump. ( seq -- )
|
: hexdump. ( sequence -- )
|
||||||
hexdump write ;
|
hexdump write ;
|
||||||
|
|
Loading…
Reference in New Issue