 
 : write-ini ( assoc -- )
     [
-        dup string?
-        [ [ escape-string ] bi@ "%s=%s\n" printf ]
-        [
+        dup string? [
+            [ escape-string ] bi@ "%s=%s\n" printf
+        ] [
             [ escape-string "[%s]\n" printf ] dip
             [ [ escape-string ] bi@ "%s=%s\n" printf ]
             assoc-each nl

    } 1&& ;

: line-continues? ( line -- ? )
    { [ empty? not ] [ last CHAR: \ = ] } 1&& ;

: section, ( -- )
    section get [ , ] when* ;

: escape-string ( str -- str' )
    H{
        { CHAR: \a   "\\a"  }
        { CHAR: \b   "\\b"  }
        { CHAR: \f   "\\f"  }
        { CHAR: \n   "\\n"  }
        { CHAR: \r   "\\r"  }
        { CHAR: \t   "\\t"  }
        { CHAR: \b   "\\v"  }
        { CHAR: '    "\\'"  }
        { CHAR: \"   "\\\"" }
        { CHAR: \\   "\\\\" }
        { CHAR: ?    "\\?"  }
        { CHAR: ;    "\\;"  }
