четверг, 24 февраля 2011 г.

Parallel front-end, Units and other tasks

Now working on 5 tasks

1. Support Units.
2. Forward types using without predeclaring.
3. Cross units references resolving with cycles too.
4. Parallel front-end to process units simultaneously.
5. Extend .NET back-end to support units.

четверг, 3 февраля 2011 г.

Changes to POINTERMATH

Now the operator[] of typed pointer returns the dereferenced pointer to type(ref to value).

Thanks to DiamondShark.

A sample

program myprogram;

procedure pf < T> (cnt:integer);
p:pointer;
ptype:^T;
valueA:T;
i:integer;
begin
GetMem(p,cnt*sizeof(T));
ptype:=p;
for i:=0 to cnt-1 do ptype[i]:=valueA;
FreeMem(p);
end;

begin
pf < boolean> (100);
pf < integer> (200);
pf < double> (300);
end

среда, 2 февраля 2011 г.

Getmem, Freemem, Pointer math

YAR language is enhanced by supporting Getmem, Freemem and pointer math.
Sample

program myprogram;

procedure dosample();
p:pointer;
pinteger:^integer;
i:integer;
begin
GetMem(p,400);
pinteger:=p;
for i:=0 to 99 do pinteger[i]^:=i;
for i:=0 to 99 do write pinteger[i]^;
FreeMem(p);
end;

begin
dosample();
end