Friday, October 7, 2011

Sweet variables are made of this


The variable assignment is a fundamental statement of any imperative language.


To assign scalars the syntax is:
a : 2;
b : a + 5;
pi : 3.14;

You can assign strings as well :
s : "Good Morning";


We can't miss arrays in our language of course:
v0 : ( );  # An empty array
v1 : (1, 2, 3, 9);
v2 : (100, "Good Night", 9.9);

No comments:

Post a Comment