[Scheme-reports] file inclusion (section 4.1.7 of draft 9) Daniel Villeneuve (08 Jun 2013 03:36 UTC)
Re: [Scheme-reports] file inclusion (section 4.1.7 of draft 9) Takashi Kato (08 Jun 2013 04:41 UTC)

Re: [Scheme-reports] file inclusion (section 4.1.7 of draft 9) Takashi Kato 08 Jun 2013 04:40 UTC

On 08/06/2013 05:38, John Cowan wrote:
> Daniel Villeneuve scripsit:
>
>> (define-syntax m
>>     (syntax-rules ()
>>       ((_) (lambda (a) (include "some/file.sch")))))
>>
>> where the file "some/file.sch" contains, say,
>>
>> (+ a 1)
>>
>> Is the symbol `a' in "some/file.sch" supposed to match the
>> lambda's argument?
>
> Yes, I believe so: files are included at the S-expression level,
> not hygienically.
>

I disagree. Since 'include' is exportable syntax then the expanded
expression should be like this;

(lambda (~a) (include "some/file.sch"))

Then compiler will compile it. Now, included 'a' is mere symbol so that
'include' includes mere S-expression. So after include should be like this;

(lambda (~a) (+ a 1))

How could compiler know these 2 symbols are the same? (I haven't checked
with current implementations, including mine, so what I'm saying might
not be the current situation, though.)

BTW, if the above macro is defined in a library, which file would be
included? The file in the same location of the library or macro caller
location?

_/_/
Takashi Kato
E-mail: ktakashi@ymail.com

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports