[racket] Call racket with long code from racket

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Thu Sep 8 17:20:44 EDT 2011

Niitsuma Hirotaka wrote at 09/08/2011 04:35 PM:
> I am trying to call racket with long code from racket
> -----------
> #lang racket
> (require racket/system)
> (display (port->string (car (process     "racket -e ' [long-code] ' "))))
> -----------
>
> But long-code contain  "  and  '   .
> Thus
>
> (process     "racket -e ' [long-long-code] ' "))
>
> does not work.
>
> How to  call racket with long code ( contain "  and  '    ) from racket
>
> Saving long-code into file can not use. Because this is part of web application.
>   

You can use "process*" instead of "process".

You can use "eval-string".

If those ways are not satisfactory, you can use processes and ports in 
more elaborate ways.

-- 
http://www.neilvandyke.org/


Posted on the users mailing list.