(Arne Babenhauserheide)
2013-12-04: some refactoring for better readability. some refactoring for better readability.
diff --git a/examples/kit-encode.w b/examples/kit-encode.w --- a/examples/kit-encode.w +++ b/examples/kit-encode.w @@ -113,42 +113,37 @@ define : kittify numbers let : : s : substring rawlogo 0 1 cond : not : equal? s "." - logofyer - string-append kittified s - string-drop rawlogo 1 - . nums - . justadded + logofyer : string-append kittified s + string-drop rawlogo 1 + . nums + . justadded ; else: we have a . : . justadded ; need one more . to separate numbers - logofyer - string-append kittified s - string-drop rawlogo 1 - . nums - . #f + logofyer : string-append kittified s + string-drop rawlogo 1 + . nums + . #f : = 0 : length nums ; no more numbers to add, just add a . - logofyer - string-append kittified s - string-drop rawlogo 1 - . nums - . #f + logofyer : string-append kittified s + string-drop rawlogo 1 + . nums + . #f ; check whether the last number was completely ; added. In that case drop the number and note that ; we just added a number : = 0 : string-length : list-ref nums 0 - logofyer - . kittified - . rawlogo - drop nums 1 - . #t + logofyer : . kittified + . rawlogo + drop nums 1 + . #t ; otherwise add the first char of the number to ; kittified and take it away from the number. else let : : firstnum : list-ref nums 0 - logofyer - string-append kittified : substring firstnum 0 1 - string-drop rawlogo 1 - append (list (string-drop firstnum 1)) : drop nums 1 - . #f ; not yet done + logofyer : string-append kittified : substring firstnum 0 1 + string-drop rawlogo 1 + append (list (string-drop firstnum 1)) : drop nums 1 + . #f ; not yet done