Displaying Data¶
In Beremiz, you can display data in various formats using the show
keyword
and string interpolation.
Showing Last Stack Element¶
The keyword show
removes and displays the last element of the stack.
Example:
String Interpolation¶
String interpolation allows you to create formatted strings by consuming elements from the stack.
- Use
$0
,$1
, etc., within a string to refer to the elements of the stack. $0
refers to the top element of the stack,$1
refers to the second element, and so on.- String interpolations consume the referenced stack elements in the process.
Example:
If you try to consume more elements than are present in the stack, an error is
raised. You can also escape the $n
using \$n
.
Example: