Move declarations into a second file
Save the rater aspersonal-auto/rater.rsl. This file is the entry point: the file you check, export and build.
Complete example: personal-auto/rater.rsl
Complete example: personal-auto/rater.rsl
personal-auto/rater.rsl
personal-auto/territory.rsl:
personal-auto/territory.rsl
personal-auto/tables/TerritoryFactor.csv:
personal-auto/tables/TerritoryFactor.csv
rater.rsl, each file it imports and each table, and checks them as one rater.
Build and rate it the same way as a rater in one file:
600 × 1.25 × 0.92 = 690.
Follow the import rules
- Write each
importon its own line, outside the sections. The example writes its imports afterspec. - A path is relative to the file that writes the
import. A path that starts withstd/names the standard library. - An imported file holds sections such as
Types,ConstantsandTables. The rater reads them as its own. - Each name has one declaration across the files.
- The
specblock of the entry point applies to every file. - An imported file may import other files. Two files that import each other fail the check.
- Keep each imported file inside the folder of the entry point. A bundle holds that one folder.
E-UNRESOLVED, with the file and the line.
Name each CSV file from its declaring file
- A table names its rows with
path, and the path starts at the folder of the file that declares the table. - An enumeration declared as
Name = Enum {path: "…"}names its member file the same way. - Each path stays inside the folder of its declaring file, so the bundle holds every CSV file.
Check, format and export the rater
An imported file checked alone lacks the other files.
territory.rsl cites the source manual, which rater.rsl declares:
std/ppa.rsl stays out of the bundle.
Package a rater describes the other files.
Import from the standard library
The standard library holds value sets that many raters share. Import a file by itsstd/ path:
inputs lists the values each type accepts:
- The files install with the compiler, in the
stdfolder of therslcpackage. Read a file there for its full list. - Import one of these files in a rater. Several of them declare the same name, such as
MaritalStatus. - A name from an imported file is taken: choose a different name for your own type.
Related
- Use a filed rate table declares tables and their CSV files.
- Use the rslc commands covers
rslc check,rslc fmtandrslc export. - Versions explains how a bundle pins its source and tables.