HELP Plse: Pascal equivalent of C++ Overloading 
Author Message
 HELP Plse: Pascal equivalent of C++ Overloading

Good day all.

I am trying to convert C++ source to Pascal.
A Learned friend of mine explains that Pascal does not provide the
functionality of 'Overloading'. I have never heard of this,
(My C knowledge is minimal) so I am merely repeating what I have heard.

A few examples of the C++ declarations...
-----------------------------------------------------------------
inline vector_4 operator-( point_4 const &Operand1, point_4 const &Operand2 );
inline vector_4 operator+( vector_4 const &Operand1,
    vector_4 const &Operand2 );
inline vector_4 operator-( vector_4 const &Operand1,
    vector_4 const &Operand2 );
inline vector_4 operator*( vector_4 const &Multiplicand,
    real const &Multiplier );
inline vector_4 operator*( real const &Multiplier,
    vector_4 const &Multiplicand );
inline point_4 operator+( point_4 const &Operand1, vector_4 const &Operand2 );
inline point_4 operator-( point_4 const &Operand1, vector_4 const &Operand2 );
inline point_4 operator+( vector_4 const &Operand2, point_4 const &Operand1 );
-----------------------------------------------------------------

Please could someone enlighten me as to how I can go about the conversion...

Thanks in advance..
Information Technology / Inligtings Tegnologie
Telkom S.A.




Wed, 18 Jun 1902 08:00:00 GMT  
 HELP Plse: Pascal equivalent of C++ Overloading

Quote:

>Good day all.
>I am trying to convert C++ source to Pascal.
>A Learned friend of mine explains that Pascal does not provide the
>functionality of 'Overloading'. I have never heard of this,
>(My C knowledge is minimal) so I am merely repeating what I have heard.
>A few examples of the C++ declarations...
>-----------------------------------------------------------------
>inline vector_4 operator-( point_4 const &Operand1, point_4 const &Operand2 );
>inline vector_4 operator+( vector_4 const &Operand1,
>    vector_4 const &Operand2 );
>inline vector_4 operator-( vector_4 const &Operand1,
>    vector_4 const &Operand2 );
>inline vector_4 operator*( vector_4 const &Multiplicand,
>    real const &Multiplier );
>inline vector_4 operator*( real const &Multiplier,
>    vector_4 const &Multiplicand );
>inline point_4 operator+( point_4 const &Operand1, vector_4 const &Operand2 );
>inline point_4 operator-( point_4 const &Operand1, vector_4 const &Operand2 );
>inline point_4 operator+( vector_4 const &Operand2, point_4 const &Operand1 );
>-----------------------------------------------------------------

Your friend is correct. You will have to provide methods that do the
different types of multiplication, etc.

TYPE
  Vector4Ptr = ^Vector4;
  Vector4    = OBJECT(???)
    PROCEDURE SubtractPoint (Operand1, Operand2 : Point4);
    PROCEDURE SubtractVector(Operand1, Operand2 : Vector4);
      ...
    END;

Paul

| Windows Database, Communications, Client/Server Programming & Design |
+----------------------------------------------------------------------+
|           Error in Reality.Sys!      Run BigBang.Exe???              |
+----------------------------------------------------------------------+



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Looking for equivalent to 'friend'(C++) in object pascal

2. What is the equivalent of the UNIT in C or C++

3. Function Overload in Gnu Pascal ?

4. Is operator overloading possible in Turbo Pascal ?

5. overloading operators in object pascal?

6. HELP needed - OVERLOADING OPERATORS????

7. HELP needed - OVERLOADING OPERATORS????

8. __LINE__ equivalent in Borland Pascal ?

9. c language lpvoid equivalent in pascal

10. Equivalent to MAKEP in Speed Pascal/2?

11. Pascal equivalent of 2 QBasic-functions.

12. SunWorks Pascal IOResult equivalent?

 

 
Powered by phpBB® Forum Software