On this page:
register-external-file
register-external-module

1.6 Compilation Manager Hook for Syntax Transformers

 (require compiler/cm-accomplice) package: base

procedure

(register-external-file file    
  [#:indirect? indirect?])  void?
  file : (and path? complete-path?)
  indirect? : any/c = #f
Logs a message (see log-message) at level 'info to a logger named 'cm-accomplice. The message data is a file-dependency prefab structure type with two fields; the first field’s value is file and the second field’s value is #f (to indicate a non-module dependency). If the indirect? argument is true, the data is more specifically an instance of a file-dependency/options prefab structure type that is a subtype of file-dependency with one extra field: a hash table mapping 'indirect to #t.

A compilation manager implemented by compiler/cm looks for such messages to register an external dependency. In response, the compilation manager records (in a ".dep" file) the path as contributing to the implementation of the module currently being compiled. Afterward, if the registered file is modified, the compilation manager will know to recompile the module. An indirect dependency has no effect on recompilation, but it can signal to other tools, such as a package-dependency checker, that the dependency is indirect (and should not imply a direct package dependency).

The include macro, for example, calls this procedure with the path of an included file as it expands an include form.

procedure

(register-external-module file    
  [#:indirect? indirect?])  void?
  file : (and path? complete-path?)
  indirect? : any/c = #f
Like register-external-file, but logs a message with a file-dependency prefab structure type whose second field is #t.

A compilation manager implemented by compiler/cm recognizes the message to register a dependency on a module (which implies a dependency on all of that module’s dependencies, etc.).