BEE Variables are simple but powerful. They are simple because there is only one data structure – array. No pointers and data type constraints, everything is purely string macros.
For example, after var abc = "myvalue";, variable abc contains the literal "myvalue". Then after we do var xyz = "abc";, we got xyz containing "abc" and {xyz} containing "myvalue". Now we create an array out of thin air (as it's already there): var abc:april = "fool"; var abc:may = "flower";, then {abc|list} will give "''=>'myvalue','april'=>'fool','may'=>'flower'", and so will {{xyz}|list} because {xyz} evaluates to abc, and {{xyz}|list} evaluates to {abc|list}. We've just changed the language from "containing" to "evaluating". Now you got the idea. (Please note that "list" used in the above example is called a BEE Conversion to convert an array into a displayable string.)
Curly bracketed variables always evaluate to a string. To specify the variable as a whole with all its array elements, you need to use the (var) cast.
In the following sample code, the comment lines (the ones starting with "//") indicate the possible evaluations, where the arrow "->" means "evaluates to".
var abc = "myvalue";
// {abc} -> myvalue
// {abc:} -> myvalue
var xyz = "abc";
// {xyz} -> abc
// {{xyz}} -> {abc} -> myvalue
var abc:april = "fool";
// {abc:april} -> fool
var abc:may = "flower";
// {abc:may} -> flower
// {abc|list} -> ''=>'myvalue','april'=>'fool','may'=>'flower'
// {{xyz}|list} -> {abc|list} -> (ditto)
var yourval = "{abc}";
// {yourval} -> {yourval:} -> myvalue
// {yourval|list} -> =>myvalue
var def = (var)abc;
// {def} -> {def:} -> myvalue
// {def|list} -> =>myvalue,april=>fool,may=>flower
Please note that the double quotation marks surrounding the values (the right-hand-side of the assignment) are optional, and can be replaced by single quotation marks. If there is no spaces in the value string, the quotation marks can be omitted altogether.
|