CLSN is a convenient Pascal version working with Heap like BASIC XE out of a Box!
And it's heap is ALL 130XE extended memory 16*3 = 48k. (Do you like it?)
Being a strictly type-care language Pascal itself can NOT be too simple.
BUT. It's really simple!
I leave PL65 for CLSN!!!
CLSN is THE ONLY high level language feeling HIGH-leveled itself.
Please look at Action!
- It's realy Atari-Lang but It's not compartible with any other machine.
- I'm an Atari FAN but I want to transfer my ideas to a world!
IDEAS I mean! And what is the IDEA above Action! itself?
Moreover, rtlibs placing separately on disk, killed dosen langs:
- all C dialects
All the attempts to make serious high level lang beyond BASIC failed on Atari, but CLSN.
Let's try CLSN!
The main Idea to work with ATARI heap is to supply compiler with acceptable data.
AND WHAT IS IT?
- the consensus of types
- the consensus of data
Let's try to make bytes area on heap. Can do you like?
Don't forget to remember that Pascal is strictly... etc.
- At first for the case of heap we need some pointer type, because of it's THE ONLY way to point to never declared entity. (* It's the only exception in Pascal's too striked typization *)
- At second we need to declare THE entity itself!
- At third we need to make variable(static) to touch to every point of our beloved entity on heap!
Here is the code to make Dinamic Array on heap.
arrP = ^arrT;
arrT = array[1..1] of byte;
(* On this stage there are no any array on Heap! *)
(* But array is clearly declared as one-dimensioned! And it's size is 1 byte. *)
(* Size means NOTHING for declaration! It's for compiler itself! We can redimension it while runtime!!! *)
a: arrP; (* Here we have created a static variable 'a' to access dynamic data. It's possible because of early accurate Pascal typyzation! *)
writeln('Enter number of array elements');
(* Dynamic programming *)
getmem(a, sizeof(byte)*num); (* We've got a needed part of memory. Now it's marked as used in Pascal. *)
for i := 1 to num do begin
writeln('Enter ', i , '-th array element');
(* Then all array-oriented cycles can use 'num' as a max-border *)
freemem(a,num*sizeof(byte)); (* freeing used earlier memory *)
If you are interested in Linked Lists in Pascal I can give you freely used codes...