FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version

record-source-file

Arguments: fspec &key type

This function is used to record the location of built-in and user defined objects in source files.

The built-in types and the forms that use them are:

Type Used with these forms:
:operator defun, defmacro
:variable defconstant, defparameter, defvar
:special-declaration defconstant, defparameter, defvar
:compiler-macro define-compiler-macro
:setf-method defsetf
:type defclass, defstruct, deftype

For example, putting the following form into a file, compile and loading it: (defun foo (x) ...) will cause foo to be recorded as an :operator in the file in which it was defined.

Redefinition warnings occur when a file is loaded and it defines an object of an already existing source file recording type. Objects of different types, say an :operator and :type, do not cause redefinition warnings.

Users can extend this facility to understand objects they define. The most usual case is a macro that defines a high-level object, such as:

(defmacro def-frob (name fram)
  `(progn
     (record-source-file ',name :type :frob)
     (def-frob-1 ',name ,fram)))

;;  We assume def-frob-1 exists and does something useful. 
;;  Here is a dummy def-frob-1 that make sthe example work:
(defun def-frob-1 (name fram) (declare (ignore name fram))
  nil)

Then, if the following form is put into /a/b/foo.cl:

(def-frob akbar 'fez)

and is then compiled and loaded, (source-file 'akbar :frob) will return a pathname pointing to /a/b/foo.cl.

See also source-file-recording.htm for general information on source file recording in Allegro CL.


Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.
Created 2009.7.29.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version