chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Macros and loading compiled code


From: alex
Subject: Re: [Chicken-users] Macros and loading compiled code
Date: Wed, 10 Sep 2014 21:15:01 -0700
User-agent: Roundcube Webmail/0.9.5

Thank you, everyone, for responding so quickly. You helped me fix my problems. I'm now passing my source file with my macro definition to the compiler with the "-extend" option.

Here was my first problem:

I defined a macro. I compiled it separately and built it into my main
program.

If the macro expressions are compiled, then the compiler must be aware of the macro definition at the same time it is compiling the macro expression, just as Peter said. The compiled macro definition can't be linked after the fact.

Here was my second problem:

I tried passing both the source file and the macro definition file as
input to the compiler.

I figured that the compiler might need to know the macro definition when it compiled the macro expression. But the right way to do this is not literally passing two source files, as in "csc macro-def.scm main.scm". The right way is to use the "-extend" option, as in "csc -extend macro-def.scm main.scm".

--Alex

P.S. I also tried making a module of the macro definition for the same purpose, and this too was successful. However, the way I have my compilation process set up, leaving it as ordinary source code is more convenient.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]