]> gitweb.factorcode.org Git - factor.git/commitdiff
compression.lzw: better naming
authorKeith Lazuka <klazuka@gmail.com>
Sat, 26 Sep 2009 19:17:52 +0000 (15:17 -0400)
committerKeith Lazuka <klazuka@gmail.com>
Mon, 28 Sep 2009 20:01:24 +0000 (16:01 -0400)
basis/compression/lzw/lzw-docs.factor
basis/compression/lzw/lzw.factor

index 3e738a3649c3d74edc5dd7392799eabf3ca7cb97..c43a2d5a37cea7f5f4e9faff447953eeb518803d 100644 (file)
@@ -25,11 +25,11 @@ HELP: lzw-read
 }
 { $description "Read the next LZW code." } ;
 
-HELP: lzw-read*
+HELP: lzw-process-next-code
 { $values
     { "lzw" lzw } { "quot" quotation }
 }
-{ $description "Read the next LZW code and call " { $snippet "quot" } " with the lzw object and the LZW code only if the code is neither the Clear Code nor the End of Information Code. If it does read a Clear Code, this combinator will take care of handling the Clear Code for you." } ;
+{ $description "Read the next LZW code and, assuming that the code is neither the Clear Code nor the End of Information Code, conditionally processes it by calling " { $snippet "quot" } " with the lzw object and the LZW code. If it does read a Clear Code, this combinator will take care of handling the Clear Code for you." } ;
 
 HELP: <lzw-uncompress>
 { $values
index 43752584d345b6ad29ef4325cfd0562cf696ac65..72de6f828cc99a7e06b6d320fe978f8725f8ae5b 100644 (file)
@@ -75,7 +75,7 @@ M: gif-lzw code-space-full?
 : clear-code? ( lzw code -- ? ) swap clear-code>> = ;
 
 DEFER: handle-clear-code
-: lzw-read* ( lzw quot: ( lzw code -- ) -- )
+: lzw-process-next-code ( lzw quot: ( lzw code -- ) -- )
     [ lzw-read ] dip {
         { [ 3dup drop end-of-information? ] [ 3drop ] }
         { [ 3dup drop clear-code? ] [ 2drop handle-clear-code ] }
@@ -90,7 +90,7 @@ DEFER: lzw-uncompress-char
         [ write-code ]
         [ code>old-code ] bi
         lzw-uncompress-char
-    ] lzw-read* ;
+    ] lzw-process-next-code ;
 
 : handle-uncompress-code ( lzw -- lzw )
     dup code-in-table? [
@@ -109,7 +109,8 @@ DEFER: lzw-uncompress-char
     ] if ;
     
 : lzw-uncompress-char ( lzw -- )
-    [ >>code handle-uncompress-code lzw-uncompress-char ] lzw-read* ;
+    [ >>code handle-uncompress-code lzw-uncompress-char ]
+    lzw-process-next-code ;
 
 : lzw-uncompress ( bitstream code-size class -- byte-array )
     <lzw-uncompress>