Decisions and loops
<for each="n" in="1..16">
<if $n % 15 == 0>
<echo>FizzBuzz</echo>
<continue />
</if>
<if $n % 3 == 0>
<echo>Fizz</echo>
<continue />
</if>
<if $n % 5 == 0>
<echo>Buzz</echo>
<continue />
</if>
<echo>{ $n }</echo>
</for>for n in 1..16 {
if $n % 15 == 0 {
echo 'FizzBuzz'
continue
}
if $n % 3 == 0 {
echo 'Fizz'
continue
}
if $n % 5 == 0 {
echo 'Buzz'
continue
}
echo "{ $n }"
}1..16 counts from 1 up to 15 (the end is left out). Comparisons are written <, <=, >, >=, == and !=, and conditions are joined with the words and, or and not.
match picks one arm. Each arm is pattern => result, with _ for anything else:
<let name="day" value="'Sat'" />
<match $day>
<case is="'Sat', 'Sun'">
<echo>Weekend</echo>
</case>
<default>
<echo>Weekday</echo>
</default>
</match>$day = 'Sat'
match $day {
'Sat', 'Sun' => echo 'Weekend'
_ => echo 'Weekday'
}