Commits

Meikel Brandmeyer  committed deabcc2

Make send-message use pretty print instead of stringify

  • Participants
  • Parent commits 2fc603a

Comments (0)

Files changed (1)

File nrepl-client/nrepl-client/nrepl-client.factor

 ! THE SOFTWARE.
 
 USING: accessors combinators io io.encodings.utf8 io.sockets kernel
-    math math.parser sequences strings uuid ;
+    math math.parser prettyprint sequences strings uuid ;
 IN: nrepl-client
 
-: stringify ( string -- newstring )
-    [ { { [ dup CHAR: " = ] [ drop { CHAR: \ CHAR: " } >string ] }
-        { [ dup CHAR: \ = ] [ drop { CHAR: \ CHAR: \ } >string ] }
-        [ 1string ] } cond ] { } map-as "" concat-as ;
-
 TUPLE: message id code stdin ;
 : <message> ( code stdin -- message )
     uuid1 2over message boa swap drop swap drop ;
    drop ;
 
 : send-message ( message -- response )
-    "3"        print
-    "\"id\""   print "\"" write dup id>>    stringify write "\"" print
-    "\"code\"" print "\"" write dup code>>  stringify write "\"" print
-    "\"in\""   print "\"" write dup stdin>> stringify write "\"" print
+    "3"          print
+    """"id""""   print dup id>>    .
+    """"code"""" print dup code>>  .
+    """"in""""   print dup stdin>> .
     flush
     id>> <response> ;