This site has been deprecated. Do not edit pages here. Please visit the new Pico Labs documentation.


Skip to end of metadata
Go to start of metadata

KRL extended quotes support the beesting operator, making them simple templating systems. Inside an extended quote, expression values can be referenced using the #{<expr>} syntax. For example, suppose you've stored 10 and 20 in the variables a and b:

The value of somevar would be "The average of 10 and 20 is 15."

Non-Scalar Values

You cannot insert non-scalar values into a string using the beesting syntax. For non-scalars, use the encode() operator on the value first to turn it into a string.

Because of a limitation in the parser, you cannot use expressions that contain a right curly brace, }, inside a beesting. The parser simply finds the first right curly brace after the start of the beesting and considers that the end. So, for example, you cannot do this

somevar = <<
This is my first name: #{name{first}}
>>;
Labels: