Include is an operation on source code (it includes the text of a file in the current one).<br>
A function call is an operation on scheme values.<br>
<br>
So, it's going to be hard in scheme… (CL has ways to use macros at run-time I think)<br>
If you know your list, you can try something like<br>

<br>
(define-macro (load-all-files . files)<br>
  (if (null? files)<br>
    #f<br>
    `(begin<br>
        (include ,(car files))<br>
        (load-all-files ,@(cdr files)))))<br>
<br>
but you need to call it with the list of files in the source (that is, "(load-all-files f1 f2 f3)")<br>

<br>
Another, dirtier way, I guess, would be to READ your files, append them to your quoted dynamic code, and to eval it all…<br>
<br>
P!<br><br><div class="gmail_quote">2009/2/14 François Magnan <span dir="ltr"><<a href="mailto:francois.magnan@licef.ca">francois.magnan@licef.ca</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi fellow Gambitters,<br>
<br>
I have a problem trying to dynamically load scheme files that contains<br>
macros. I know that when a file contains a macro, the macro definition<br>
must be in the same file as the macro usage.  If not, one must use the<br>
(include ....) special form to import the macro definition.<br>
<br>
I would like to be able to use (include ...) inside a function to<br>
programmatically include some files like (load ...) can do.<br>
<br>
<br>
For example, if<br>
<br>
(for-each (lambda (file)<br>
            (include file))<br>
          '("file1" "file2" ...))<br>
<br>
*** ERROR IN (console)@2.15 -- Filename expected<br>
<br>
could work!<br>
<br>
Is there any way to make this work without appending all the files<br>
together.<br>
<br>
Thank you,<br>
Francois Magnan<br>
<br>
<br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Français, English, 日本語, 한국어<br><br>