Smart pascal source code
type
TBase = record
Field: String;
private const cPrivate = 1;
public
class const cPublic = 3;
procedure WriteLnAll;
class procedure ClassWriteLnAll;
end;
procedure TBase.WriteLnAll;
begin
WriteLn('From base');
WriteLn(cPrivate);
WriteLn(cPublic);
end;
class procedure TBase.ClassWriteLnAll;
begin
WriteLn('From class proc');
WriteLn(cPrivate);
WriteLn(cPublic);
end;
var o: TBase;
WriteLn('From Outside');
WriteLn(TBase.cPublic);
WriteLn(o.cPublic);
TBase.ClassWriteLnAll;
o.WriteLnAll;
{<<< RESULT - CONSOLE LOG >>>
-----------------------------
From Outside
3
3
From class proc
1
3
From base
1
3
-----------------------------
{<<<<<<<<< THE END >>>>>>>>>}
function Copy$TBase(s,d) {
return d;
}
function Clone$TBase($) {
return {
}
}
function TBase$WriteLnAll(Self$1) {
WriteLn("From base");
WriteLn(1);
WriteLn(3);
}
function ClassWriteLnAll() {
WriteLn("From class proc");
WriteLn(1);
WriteLn(3);
}
var o = {Field:""};
/* <<< main JS >>> */
WriteLn("From Outside");
WriteLn(3);
WriteLn(3);
ClassWriteLnAll();
TBase$WriteLnAll(o);