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

Re: [Scheme-reports] file inclusion (section 4.1.7 of draft 9)

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 

Takashi Kato
E-mail: ktakashi@x

Scheme-reports mailing list