The Basics

PDS has two primitive types: strings and floating-point numbers. You don’t need to declare variables, and they can change types. Variables are referenced by preceding them with a dollar sign. Values are converted to the appropriate type depending on context. For instance, a string is converted to a number when it appears in an arithmetic expression. The grammar forbids certain combinations of expressions to catch common mistakes.

For example, if you add a string to a number, the string is converted to a number.

a = 7
b = "1.5"
c = $a + $b                 # value is 8.5
d = 7 + "1.5"               # disallowed

You can also do variable substitution within quotes. Use braces around a variable to separate it from adjacent text. For example:

a = "New"
b = "$a York"                # b equals "New York"
c = "${a}ark"                # c equals "Newark"