[racket] Program compiles with racket fails when invoked with execl()

From: bbi5291 (bbi5291 at gmail.com)
Date: Fri Sep 17 04:32:37 EDT 2010

Consider the simple Racket program

--------------------
#lang racket
(+ (read) (read))
--------------------

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

--------------------
#include <unistd.h>
int main()
{
        execl("aplusb","aplusb",(char*)0);
}
--------------------

where "aplusb" is the name of the Racket program, it exits immediately with
the errors:

--------------------
with-input-from-file: expects type <path or string> as 1st argument, given:
#f; other arguments were: #<procedure>

 === context ===
embedded-load

--------------------

How can I fix this problem? I am using Racket v5.0.1 on Ubuntu 9.10 (i386).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100917/a71a04cc/attachment.html>

Posted on the users mailing list.