se find [options] [<ACEfile.ace>] <Class>
The find command tells you which file is loaded when searching for an Eiffel <Class>.
When an Eiffel file is found, find prints the full path name on standard output.
The exit status is set GENERAL.exit_success_code only when an existing file is found (thus allowing usage of the find command in shell scripts). As for other commands, when the ACE file mode is used, only the content of the <ACEfile.ace> file is used to search the source file. To see the loading path used by SmartEiffel, you can for example type the find command using a bad (inexistent) class name. In ACE file mode, the loading path can be updated by modifying the ACE file itself. In traditional mode (i.e. no ACE file), the default loading path may also be tailored (see below).
Display a brief summary of the command-line syntax and a complete list of find options.
Show the number of the version of SmartEiffel you're using.
Print system information during the compilation (full path of loaded files, type inference score, removed files, etc.).
Adds a loadpath file for class lookup. See below for details on the loading path constitution.
Where Does find Search?
The algorithm used by SmartEiffel to look for an Eiffel source file is the following:
- Lower case filenames - SmartEiffel looks all along the loading path (see below) using <class> name in lower case as tail. If needed, the Eiffel suffix (".e") is added automatically. SmartEiffel only looks for suffixed files on the disk. Only the first file encountered according to the order of the path is taken in account. File is always supposed to have the same name as the inside class definition.
- Upper case filenames - When the previous step did not find the required Eiffel class file, SmartEiffel looks along the loading path (see below) for a file bearing the class name upper in upper case letters. If needed, the Eiffel suffix ".e" is added automatically. One must note that the overhead to find an upper case file name is not negligible at all and that a lower case file name may hide some upper case name.
How is the loading path built?
As described above, SmartEiffel looks for classes in .e files. But where should those files be situated? The answer is, in the loading path. The thing is, how is the loading path built, what are the default values, and how can it be changed?
Note: The following applies only if no ACE file is provided. If an ACE file is provided, only the listed clusters in that file are considered.
There are many things that are taken into account. Let's take them in order, from the most important to the least (i.e., in the order SmartEiffel looks in; remember that the first filename that matches is used, thus allowing class covering).
- The loadpath files given on the command line (using -loadpath) are searched first.
- If the current directory contains a file named loadpath.se, this file is used as loadpath file; otherwise, the current directory is considered as a path where to look for classes (this allows very simple projects not to define any loadpath file).
- At last, the loadpath files of the configuration file are used.