Thanks for the tip Eli, that seems like what I'm looking for. I can't actually figure out how to use it for files though; when I write<br>--------------------<br>(make-evaluator 'racket (string->path "aplusb.scm"))<br>
--------------------<br>I get the error message<br>--------------------<br>open-input-file: `read' access denied for aplusb.scm"<br>--------------------<br>even though I definitely have read access to this file.<br>
If I try<br>--------------------<br>(define aplusb (open-input-file "aplusb.scm"))<br>(make-evaluator 'racket aplusb)<br>--------------------<br>
then the error message is<br>--------------------<br>exception raised by error display handler: directory-exists?: `exists' access denied for /; original exception raised: module: illegal use (not at top-level)<br>--------------------<br>
It works fine when I give the second argument as a string or an s-expression but that wouldn't work well for the intended application.<br><br>Have I misunderstood the documentation?<br><br><div class="gmail_quote">On Fri, Sep 17, 2010 at 4:32 AM, bbi5291 <span dir="ltr"><<a href="mailto:bbi5291@gmail.com">bbi5291@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Consider the simple Racket program<br><br>--------------------<br>#lang racket<br>(+ (read) (read))<br>
--------------------<br><br>When this is compiled using raco, the executable produced works exactly as intended, reading two integers on standard input and printing their sum. However, when I run the C program<br>
<br>--------------------<br>#include <unistd.h><br>int main()<br>{<br> execl("aplusb","aplusb",(char*)0);<br>}<br>--------------------<br><br>where "aplusb" is the name of the Racket program, it exits immediately with the errors:<br>
<br>--------------------<br>with-input-from-file: expects type <path or string> as 1st argument, given: #f; other arguments were: #<procedure><br><br> === context ===<br>embedded-load<br><br>--------------------<br>
<br>How can I fix this problem? I am using Racket v5.0.1 on Ubuntu 9.10 (i386).<br>
</blockquote></div><br>