That is what I would have guessed, which is why I was careful to say it's not a big thing.. not at all. What's a few keystrokes here and there, to instead get really useful, cool features?
Author
Message
Austin POL Developer
Joined: 30 Jan 2006 Posts: 355 Location: San Diego, California
Posted: Tue Jun 27, 2006 10:47 pm Post subject:
Im just starting to get += to work...
I am testing it with RunECL
I can do
var i := 5;
i+=3;
Print ("->"+i);
and get 8
if I do i += 5+3; I get a compiler error (for now)
but i += (5+3) will work just fine..
Good things.
Author
Message
Austin POL Developer
Joined: 30 Jan 2006 Posts: 355 Location: San Diego, California
Posted: Wed Jun 28, 2006 5:27 am Post subject:
Okay got this to all work properly in runecl
Code:
program MathTest()
var i := 5;
i += 3+4;
var j := array;
j[1] := 3;
j[1] += 5;
Print("->"+i);
Print("->"+j[1]);
var temp := "Aust";
temp += "in";
Print("->"+temp);
return 1;
endprogram
So += -= and such could be a very real possibility in 097.
Gimme some other stuff you would throw at it (only += is in right now) to test...!
Only other things I could think of to test out would be:
Code:
program Test(who)
var s := struct;
s.+z := 0;
s.+z_mod := 5;
s.z += 5;
s.z += s.z_mod;
s.z += "what will this do?";
s.z += who; // this, too, just to know.
who.color += 1;
endprogram
So, just basically making sure it would all work as expected with structs (and dictionaries, of course), and object members, and also to make sure that adding different types of data doesn't throw monkey wrenches into things.
Author
Message
Austin POL Developer
Joined: 30 Jan 2006 Posts: 355 Location: San Diego, California
Posted: Wed Jun 28, 2006 7:06 am Post subject:
Okay heres what I tested in the first code block.
The second is the output given.
Code:
program MathTest()
PlusEqualTests();
MinusEqualTests();
endprogram
function PlusEqualTests()
Print("\nPlusEqual Tests()");
var a := 1;
a += 2;
Print("A->"+a);
var b := 1;
b+= 4+3;
Print("B->"+b);
var c := array{1};
c[1] += 3;
Print("C->"+c);
var d := array{"A"};
var e := array{"B"};
d+=e;
Print("D->"+d);
var f := struct;
f.+A := 1;
f.A+=3;
Print("F.A->"+f.A);
var g := "PO";
g+="L";
Print("G->"+g);
var h;
for ( h:=0; h<=2; h+=1 )
print("H->"+h);
endfor
var i := dictionary;
i["A"] := 1;
i["A"] += 3;
Print("i['A']->"+i["A"]);
return 1;
endfunction
function MinusEqualTests()
Print("\nMinusEqual Tests()");
var a := 3;
a -= 2;
Print("A->"+a);
var b := 4;
b-= 3-1;
Print("B->"+b);
var c := array{5};
c[1] -= 3;
Print("C->"+c);
var d := array{"A", {"B"}};
var e := array{"B"};
d-=e;
Print("D->"+d);
var f := struct;
f.+A := 7;
f.A-=3;
Print("F.A->"+f.A);
var g := "POLLL";
g-="LL";
Print("G->"+g);
var h;
for ( h:=3; h>=0; h-=1 )
print("H->"+h);
endfor
var i := dictionary;
i["A"] := 4;
i["A"] -= 3;
Print("i['A']->"+i["A"]);
return 1;
endfunction
Code:
PlusEqual Tests()
A->3
B->8
C->{ 4 }
D->{ A, { B } }
F.A->4
G->POL
H->0
H->1
H->2
i['A']->4
MinusEqual Tests()
A->1
B->2
C->{ 2 }
D->{ A, { B } }
F.A->4
G->POL
H->3
H->2
H->1
H->0
i['A']->1
Author
Message
Austin POL Developer
Joined: 30 Jan 2006 Posts: 355 Location: San Diego, California
Posted: Thu Jun 29, 2006 4:06 am Post subject:
Okay your wish was granted, we got += -= *= /= and %=
Note: No one ask for i++ ++i i-- --i for a while, thats a whole 'nother story.
Also I went into POL ( I did most my testing in RunECL ) I disabled all the packages except for what was required.. and then did two for loops that started at 0 and counted to 10000