rslc compiler.
Write a rater
Save this file ashello/rater.rsl. It charges $2 for each $1,000 of payroll:
hello/rater.rsl
rslc examples get minimal --out hello saves the same file. The Records section holds the rule:
payrollis an input. Its type says a whole number from 0 to 100,000,000.premiumis a calculation. It rounds to the cent, half up, and cites page 3 of the manual.
Check it
PASS means that the rater gives a premium for every request it accepts.
The cost line is the work of one rating. Here it is a constant.
Compute a premium
A scenario gives the rater one set of inputs and the value you expect. Save this file ashello/first.rsl:
hello/first.rsl
Make a mistake
Charge by the employee, and let a request send zero employees. Save this file asbroken/rater.rsl:
broken/rater.rsl
broken/rater.rsl
broken/rater.rsl
rslc explain gives the reason for a message, a rater that gets it, and the fix:
employees at 1.
Next steps
- Language guarantees states what a passing check means.
- Write your first rater builds a rater with a rate table from a rating manual.
- RSL at a glance shows each part of the language on one page.