Commits

Meikel Brandmeyer committed b0f2697

Add print-response

  • Participants
  • Parent commits 373a051

Comments (0)

Files changed (1)

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

 
 : read-response ( response -- response )
     [ dup status>> "done" = not ] [ read-response-chunks ] while ;
+
+: print-response ( response -- )
+   "{" write
+   " \"stdout\" : \""    write dup stdout>> write "\"," write
+   " \"stderr\" : \""    write dup stderr>> write "\"," write
+   " \"value\" : \""     write dup value>>  write "\"," write
+   " \"namespace\" : \"" write dup nspace>> write "\" " write
+   "}" print
+   flush
+   drop ;