Smart pascal source code
var v: Variant := 0;
procedure TestFloat(var f: Float);
begin
f := v;
end;
var f: Float;
TestFloat(f);
WriteLn(f - f);
procedure TestInteger(var i: Integer);
begin
f := v;
end;
var i: Integer;
v := 1.0;
TestInteger(i);
WriteLn(i - i);
procedure TestString(var s: String);
begin
s := v;
end;
var s: String;
v := 'hello';
TestString(s);
WriteLn(v + v);
procedure TestBool(var b: Boolean);
begin
b := v;
end;
var b: Boolean;
v := True;
TestBool(b);
WriteLn(b and b);
{<<< RESULT - CONSOLE LOG >>>
-----------------------------
0
0
hellohello
True
-----------------------------
{<<<<<<<<< THE END >>>>>>>>>}
function TestString(s$1) {
s$1.v = String(v);
};
function TestInteger(i$1) {
f.v = Number(v);
};
function TestFloat(f$1) {
f$1.v = Number(v);
};
function TestBool(b$1) {
b$1.v = (v?true:false);
};
var v,
f = {};
f.v = 0;
var i = {};
i.v = 0;
var s = {};
s.v = "";
var b = {};
b.v = false;
/* <<< main JS >>> */
v = 0;
TestFloat(f);
WriteLn((f.v-f.v));
v = 1;
TestInteger(i);
WriteLn((i.v-i.v));
v = "hello";
TestString(s);
WriteLn((v+v));
v = true;
TestBool(b);
WriteLn((b.v&&b.v));