[plt-scheme] Re: compile: bad syntax; function application is not allowed

From: Robby Findler (robby at cs.uchicago.edu)
Date: Fri Jul 25 19:08:35 EDT 2008

eval uses the namespace to compile any free variables in its argument
(it does not use the lexical context where eval was called). That's
how you're getting that error -- eval is being called when the current
namespace does not have a binding for #%app. Chances are, the easier
fix is to avoid eval. Otherwise, the fix is to set up a good namespace
for eval to use.


On Fri, Jul 25, 2008 at 6:03 PM, wooks <wookiz at hotmail.com> wrote:
> On Jul 21, 7:21 am, Matthew Flatt <mfl... at cs.utah.edu> wrote:
>> At Sun, 20 Jul 2008 23:32:16 -0700 (PDT), Scott Brown wrote:
>> > When I try to load one file in another file using PLT Scheme 4 like this
>> > (load "sicp2.scm") I get the following error:
>> > "sicp2.scm:1:0: compile: bad syntax; function application is not allowed,
>> > because no #%app syntax transformer is bound in"
>> > How can I fix this?
>> The code that calls `load' is in a module, right?
>> See
>>  http://docs.plt-scheme.org/guide/eval.html#(part._namespaces)
>>  http://list.cs.brown.edu/pipermail/plt-scheme/2008-July/025652.html
>>  http://list.cs.brown.edu/pipermail/plt-scheme/2008-July/025704.html
> I am getting the same problem, but I am not trying to load anything or
> use namespaces.
> My code maps eval to procedures created on the fly. I have traced it
> with display statement - it  successfully completes a number of cycles
> of the code and crashes with this error.
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.