Introduction to Var'aq Programming
This Site is intended to provide helps to Var'aq language programmers around the world through technical examples, informational articles, and personal assistance.
The following examples are meant to be a quick Getting Started sort of tutorial using the varaq-kling.pl version in Perl.
Example 2. Arithmetic
Since Var'aq is a stack-based programming language like FORTH, arithmetic is performed using Reverse Polish Notation (RPN) which uses post-fix operators. Using post-fix notation means that the arithmetic operator appears *after* the numbers on which it operates.
PRINT 2 + 2
(print (+ 2 2 ) )
2 2 + .
2 2 boq cha'
Because of the nature of post-fix notation, normal arithmetic order of precedence is not handled by the programming language--the programmer must ensure the order of precedence himself.Basic (automatic order of precedence):
PRINT 2 + 5 * 2
(print (+ (* 5 2) 2 ) )
2 5 2 * + .
2 5 2 boq'egh boq cha'
See the Var'aq specification for the arithmetic operators supported by Var'aq.
Go back to go to the next example.