From 5ec147ee40b7126b26c8a477c579a2f1e085f8db Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 23 Sep 2016 14:48:08 -0400 Subject: [PATCH] Add margin-note relating quote-source-file to __FILE__ and __file__. --- pkgs/racket-doc/syntax/scribblings/srcloc.scrbl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/racket-doc/syntax/scribblings/srcloc.scrbl b/pkgs/racket-doc/syntax/scribblings/srcloc.scrbl index 97b0c5e229..63bb3600fe 100644 --- a/pkgs/racket-doc/syntax/scribblings/srcloc.scrbl +++ b/pkgs/racket-doc/syntax/scribblings/srcloc.scrbl @@ -289,6 +289,14 @@ or the PLaneT cache. @defform*[[(quote-character-span) (quote-character-span form)]] )]{ +@margin-note{@index['("__FILE__" "__file__")]{You can achieve an +effect similar to @tt{__FILE__} from +@hyperlink["http://perldoc.perl.org/functions/__FILE__.html"]{Perl} or +@hyperlink["http://ruby-doc.org/docs/keywords/1.9/Object.html#method-i-__FILE__"]{Ruby} +and @tt{__file__} from +@hyperlink["https://docs.python.org/3/reference/import.html#__file__"]{Python} +by using @racket[quote-source-file].}} + Quote various fields of the source location of @racket[form], or of the whole macro application if no @racket[form] is given.