[comp.lang.pascal] Turbo Pascal 5.5

rogerson@PEDEV.Columbia.NCR.COM (Dale Rogerson) (07/19/89)

As promised I played a little with TP 5.5 this past weekend and tried
a few things.  Here are some of my observations.

As I said before, you cannot overload the infix operators.  Unlike
C++ and Actor you cannot overload the meanings of +,-,/,(),[],...
In fact overloading is not allowed within the same object (scope).
This means that you can not have the following object.

	ComplexNum =  object;
		      real, imagine : Integer;
		      procedure Init;
		      procedure Init( NewReal, NewImagine : Integer );
	    	      procedure Add(aReal : Integer );
		      procedure Add(aComplex : ComplexNum);
		      end;

This is not the best example, but it is not possible to do this. 

Functions cannot return anything but SIMPLE types and strings.  No change from
the old version of TP.  This means that:
		function Add(aComplex : ComplexNum) : ComplexNum;
would be illegal. You would have to use VAR params or pointers.


Puzzler #1:

Here's a question that I have.  Suppose you want some objects which are
arrays of points something like this:

	Poly = object;
		Points : Array[1..MAX] of Point;
		procedure Init(NumberOfPoints : Integer);
		procedure Show;
		procedure Hide;
		...
		end;

Now what I really what to do is have the array Points declared at run time
with what ever size I specify in the Init call.  So how would you do
this?  

I will post my first draft solution later.  (After everyone else gives me a
better one.)

Objectively Speaking
-----Dale
	Rogerson-----