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 4. Variables
Although many operations can be performed using the stack alone, there are many more operations that require memory storage outside of the stack. Data can be stored in named memory locations through the use of variables common in all high-level programming languages.

Basic:
x = 5
Lisp:
(setq x 5)
FORTH:
5 x !
Var'aq:
5 ~ x cher
or alternately 5 "x" cher

The Perl implementation of Var'aq basically uses the lI'moH (quote, '~') operator to push a 'string' version of the word onto the stack. We can take advantage of this implementation-dependent "feature" to build variable names dynamically.

Var'aq:
5 "x" 10 tlheghrar cher (This concatenates "x" and "10" and stores 5 into "x10".)
then x10 cha' will retrieve the "5" from "x10" and print it.

Go back to go to the next example.

©Copyright 2004, Mr. Merrick J. Stemen. All rights reserved.