mit-scheme-devel
[Top][All Lists]
Advanced

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

Re: [MIT-Scheme-devel] MIT-Scheme 9.0.1 performance problem. (cont.)


From: Przemysław Soboń
Subject: Re: [MIT-Scheme-devel] MIT-Scheme 9.0.1 performance problem. (cont.)
Date: Mon, 16 May 2011 14:26:05 +0200

>   Date: Fri, 13 May 2011 23:28:03 +0200
>   From: =?UTF-8?B?UHJ6ZW15c8WCYXcgU29ib8WE?= <address@hidden>
>
>   Do you mean to compile a band file and use it later?
>
> No, I mean to compile your Scheme code to machine code.  See
> <http://www.mit-scheme.org/documentation/mit-scheme-user/Compiling-Programs.html>.
>

Thank you Taylor very much for your suggestion. After compilation the
loop is executed in 0.5 second what makes me really happy.

Unfortunately I have another problem while compiling my code. It is
related to macros. To show the problem I took a simple macro from the
reference manual:

(define-syntax push1
    (syntax-rules ()
        ((push1 item list)
            (set! list (cons item list)))))

Then I use it in the following way:

(define lst (list 1 2 3))
(push1 12 lst)
(pp lst)

The output is (12 1 2 3)

Everything works perfect if I have the macro and execution part in one
file. I compile the file and execute and get the results as expected.
The problems occur when I move the macro to another file. Then it
seems like the compiler treats the execution of push1 as a procedure
call and not a macro. I get an error: "Variable reference to a
syntactic keyword: push1". I have some shared macros and don't want to
copy them to all the other files.

I tried many options like compiling the both files, load the file with
macro before compilation. Include the macro file in a band file and
load it before compilation. Nothing works.

Thanks in advance,
Przemek



reply via email to

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