[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] file inclusion (section 4.1.7 of draft 9)
Alex Shinn scripsit:
> > (lambda (~a) (+ a 1))
> >
> > How could compiler know these 2 symbols are the same?
>
> Correct - the macro is hygienic, so the a in the file won't match the
> renamed a in the lambda.
Oddly, this isn't always what happens. Given the call `((m) 32)`,
Racket, Gambit, Guile, Kawa, SISC, Chez, Mosh, IronScheme, SXM return
33, whereas Gauche, Chicken, Chibi, STklos, S7, Owl Lisp say `a` is
undefined. See HygienicInclusion for details.
> > 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?
>
> By the time the include is expanded it has no idea in which file it
> was originally defined (barring some sort of self-introspection on
> source info), so the include path would naturally be relative to the
> caller location.
That's explicitly undefined: the implementation applies an
implementation-specific algorithm to cast the string to a file name.
--
After fixing the Y2K bug in an application: John Cowan
WELCOME TO <censored> cowan@x
DATE: MONDAK, JANUARK 1, 1900 http://www.ccil.org/~cowan
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports