wisp
 
(Arne Babenhauserheide)
2013-08-16: factor wisp line-splitting into a function.

factor wisp line-splitting into a function.

diff --git a/.bugs/bugs b/.bugs/bugs
--- a/.bugs/bugs
+++ b/.bugs/bugs
@@ -2,5 +2,6 @@ fails when I add stuff at the end of end
 throw an exception when reducing indentation to an unknown indentation level. | owner:Arne Babenhauserheide <bab@draketo.de>, open:False, id:424186bd85f186b7279c5c59e2bd42f847284719, time:1376003568.91
 implement wisp in wisp                                       | owner:Arne Babenhauserheide <bab@draketo.de>, open:True, id:6299306916706410702029289bf32edab1e7f17c, time:1367113341.49
 inline ' : should be '(                                      | owner:Arne Babenhauserheide <bab@draketo.de>, open:False, id:72d534a8b23b4cb168017f1bb7d8816f0ea170c4, time:1366497335.26
+wisp-mode: handle lines starting with underscores: currently sees the underscores as function call. | owner:Arne Babenhauserheide <bab@draketo.de>, open:True, id:b2c3755e1deb8355655a334d569679e2e62d2836, time:1376612093.55
 make this work: let : : origfile ( open-file : nth 1 : command-line ) r | owner:Arne Babenhauserheide <bab@draketo.de>, open:False, id:d6de2074a5017f1f29f34d142ce797981ed270a0, time:1366529287.67
 comments containing a closing parenthesis can break the parser. | owner:, open:False, id:d9147504868960e5fbc2648474d48ce5c9bd1a02, time:1374838747.22
diff --git a/wisp-guile.w b/wisp-guile.w
--- a/wisp-guile.w
+++ b/wisp-guile.w
@@ -230,16 +230,17 @@ define : read-whole-file filename
                     string-append text : string nextchar
                     read-char origfile
 
+define : split-wisp-lines text
+    call-with-input-string 
+        call-with-input-string text nostringandbracketbreaks
+        . splitlines 
+
+
 ; first step: Be able to mirror a file to stdout
 let* 
     : filename : list-ref ( command-line ) 1
       text : read-whole-file filename
-      lines '()
-    ; display text ; seems good
-    set! lines
-        call-with-input-string 
-            call-with-input-string text nostringandbracketbreaks
-            . splitlines 
+      lines : split-wisp-lines text
     ; display : list-ref lines 100 ; seems good
     set! lines : linestoindented lines
     let : : line : list-ref lines 158