Skip to main content
Install Relativities. The installation includes the rslc compiler.

Write a rater

Save this file as hello/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:
  • payroll is an input. Its type says a whole number from 0 to 100,000,000.
  • premium is 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 as hello/first.rsl:
hello/first.rsl
A payroll of $250,000 is 250 thousands, at $2 each: $500.

Make a mistake

Charge by the employee, and let a request send zero employees. Save this file as broken/rater.rsl:
broken/rater.rsl
The new calculation divides by an input that can be 0:
The check found the request that would fail, before any request was rated. rslc explain gives the reason for a message, a rater that gets it, and the fix:
Here the fix is one character: start the range of employees at 1.

Next steps