Re: [Scheme-reports] file inclusion (section 4.1.7 of draft 9) John Cowan (08 Jun 2013 23:36 UTC)

Re: [Scheme-reports] file inclusion (section 4.1.7 of draft 9) John Cowan 08 Jun 2013 23:35 UTC

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@ccil.org
        DATE: MONDAK, JANUARK 1, 1900           http://www.ccil.org/~cowan

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