[racket] Call racket with long code from racket

From: Rodolfo Carvalho (rhcarvalho at gmail.com)
Date: Thu Sep 8 17:07:59 EDT 2011

Hello,

You could try something like this:

#lang racket
(require racket/system)
(display (port->string (car (process *(format "racket -e '~a' " '(+ 2 3))*
))))

That is, quote your "long code" (in the case above (+ 2 3)) and pass it
through format.

HTH!

[]'s

Rodolfo Carvalho


On Thu, Sep 8, 2011 at 17:35, Niitsuma Hirotaka <hirotaka.niitsuma at gmail.com
> wrote:

> 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.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110908/bb48aa5a/attachment.html>

Posted on the users mailing list.