From 3ee55eb341936cc78e0e9d41b28a7925b88931af Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 2 Oct 2008 18:08:21 -0500 Subject: [PATCH] remove lib usage, update docs --- extra/hexdump/hexdump-docs.factor | 14 ++++++++++++-- extra/hexdump/hexdump.factor | 12 ++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/extra/hexdump/hexdump-docs.factor b/extra/hexdump/hexdump-docs.factor index adf31d3787..a83f64e8db 100644 --- a/extra/hexdump/hexdump-docs.factor +++ b/extra/hexdump/hexdump-docs.factor @@ -1,12 +1,22 @@ +! Copyright (C) 2008 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. USING: help.markup help.syntax kernel ; IN: 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." } ; 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." } { $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" diff --git a/extra/hexdump/hexdump.factor b/extra/hexdump/hexdump.factor index f444f5a4f2..618ed00802 100644 --- a/extra/hexdump/hexdump.factor +++ b/extra/hexdump/hexdump.factor @@ -1,5 +1,8 @@ -USING: arrays io io.streams.string kernel math math.parser namespaces -prettyprint sequences sequences.lib splitting grouping strings ascii ; +! Copyright (C) 2008 Doug Coleman. +! 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 -: hexdump ( seq -- str ) + +: hexdump ( sequence -- string ) [ dup length header. 16 [ line. ] each-index ] with-string-writer ; -: hexdump. ( seq -- ) +: hexdump. ( sequence -- ) hexdump write ;