Changeset 14665 in project


Ignore:
Timestamp:
05/16/09 15:27:15 (10 years ago)
Author:
sjamaan
Message:

Describe include-relative

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/s48-modules

    r14457 r14665  
    5151library, as well.
    5252
     53==== include-relative
     54
     55This module also defines the following macro as a replacement for the regular
     56{{/manual/Non-standard macros and special forms#include|include}} macro:
     57
     58<macro>(include-relative filename)</macro>
     59
     60This includes {{filename}} just like {{include}} would, but if you use
     61{{include-relative}} inside ''that'' file, it will include files
     62relative to the directory in which {{filename}} is located (include
     63would instead just try to find the file relative to the topmost file
     64you're compiling).
     65
     66This macro must be used to include Scheme 48 module/package files
     67which use {{files}} declarations to load external files.
     68
     69For example, this code:
     70
     71<enscript highlight=scheme>
     72;; file: /rootpath/foo.scm
     73(include "bar/qux.scm")
     74</enscript>
     75
     76<enscript highlight=scheme>
     77;; file: /rootpath/bar/qux.scm
     78(include "mooh/blah.scm")
     79</enscript>
     80
     81Would fail with an error because it will try to load
     82{{/rootpath/mooh/blah.scm}}.
     83
     84Whereas this would work:
     85
     86<enscript highlight=scheme>
     87(use s48-modules)
     88
     89;; file: /rootpath/foo.scm
     90(include-relative "bar/qux.scm")
     91</enscript>
     92
     93<enscript highlight=scheme>
     94;; file: /rootpath/bar/qux.scm
     95(include-relative "mooh/blah.scm")
     96</enscript>
     97 
     98
    5399=== Changelog
    54100
     101* 0.3 Add include-relative
     102* 0.2 Tests and minor bugfixes
    55103* 0.1 Initial release
    56104
Note: See TracChangeset for help on using the changeset viewer.