Re: [fpc-pascal] Converting code from C++ to FP....

2011-03-19 Thread Aleksa Todorovic
On Sat, Mar 19, 2011 at 06:07, Bo Berglund bo.bergl...@gmail.com wrote: 1) The second line in the loop contains the command std::max, how can that be translated? I have not found any class definition for std with a method max There is function Max in unit Math, so you could say: jBegin

Re: [fpc-pascal] Converting code from C++ to FP....

2011-03-19 Thread Jeppe Johansen
Den 19-03-2011 08:30, Aleksa Todorovic skrev: 2) The parameter into the function is a pointer *A of type double. To me that indicates a value of some kind, but in the code it suddenly seems to appear as an array with indexing. What would be the proper pascal translation of this? Indeed. C

Re: [fpc-pascal] Converting code from C++ to FP....

2011-03-19 Thread Ingemar Ragnemalm
Jeppe Johansen jepj...@es.aau.dk wrote: Den 19-03-2011 08:30, Aleksa Todorovic skrev: 2) The parameter into the function is a pointer *A of type double. To me that indicates a value of some kind, but in the code it suddenly seems to appear as an array with indexing. What would be the proper

[fpc-pascal] Re: Converting code from C++ to FP....

2011-03-19 Thread Bo Berglund
On Sat, 19 Mar 2011 08:30:45 +0100, Aleksa Todorovic alexi...@gmail.com wrote: On Sat, Mar 19, 2011 at 06:07, Bo Berglund bo.bergl...@gmail.com wrote: 1) The second line in the loop contains the command std::max, how can that be translated? I have not found any class definition for std with a

Re: [fpc-pascal] Converting code from C++ to FP....

2011-03-19 Thread Jürgen Hestermann
Ingemar Ragnemalm schrieb: Converting bad C code (that means almost any C code) to good FPC code is a great thing to do, converting to bad FPC code is not as much fun. Yes, when already in progress of converting to Pascal then get rid of C design flaws and convert to clear Pascal code.

Re: [fpc-pascal] Re: Converting code from C++ to FP....

2011-03-19 Thread Aleksa Todorovic
On Sat, Mar 19, 2011 at 13:03, Bo Berglund bo.bergl...@gmail.com wrote: Now I have found another very strange construct: void ForwardModel::SetMixedBoundaryCondition(const int iElec,   const double* SX0,   const double* SY0,   const double* SZ0,   double* SX,   double* SY,   double* SZ)

Re: [fpc-pascal] double dispatch

2011-03-19 Thread Jonas Maebe
On 18 Mar 2011, at 22:47, Jorge Aldo G. de F. Junior wrote: Can FPC deal with double-dispatch ? No, because overloading works the same as in C++ (determined statically at compile time). Jonas___ fpc-pascal maillist -

[fpc-pascal] Re: Converting code from C++ to FP....

2011-03-19 Thread Bo Berglund
On Sat, 19 Mar 2011 13:10:25 +0100, Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Ingemar Ragnemalm schrieb: Converting bad C code (that means almost any C code) to good FPC code is a great thing to do, converting to bad FPC code is not as much fun. Yes, when already in progress of

Re: [fpc-pascal] Re: Converting code from C++ to FP....

2011-03-19 Thread Jorge Aldo G. de F. Junior
no one explained so let me try : void ForwardModel::SetMixedBoundaryCondition(const int iElec, void somefunction means its a pascal procedure const double* SX0, const has the same effect as fpc const before a parameter, double* SX0 is the same as double *SX0 or double * SX0 so this

[fpc-pascal] Re: double dispatch

2011-03-19 Thread leledumbo
No, because overloading works the same as in C++ (determined statically at compile time). Are you sure, Jonas? Because I've been able to implement visitor pattern which is a kind of double dispatch. Of course it's not implemented like the example posted by the OP, but more like a simulation

Re: [fpc-pascal] Re: double dispatch

2011-03-19 Thread Jonas Maebe
On 19 Mar 2011, at 15:58, leledumbo wrote: No, because overloading works the same as in C++ (determined statically at compile time). Are you sure, Jonas? Yes. Because I've been able to implement visitor pattern which is a kind of double dispatch. Of course it's not implemented like the

Re: [fpc-pascal] Re: double dispatch

2011-03-19 Thread Marco van de Voort
In our previous episode, leledumbo said: No, because overloading works the same as in C++ (determined statically at compile time). Are you sure, Jonas? Because I've been able to implement visitor pattern which is a kind of double dispatch. Of course it's not implemented like the example

[fpc-pascal] Re: Converting code from C++ to FP....

2011-03-19 Thread Bo Berglund
On Sat, 19 Mar 2011 11:30:47 -0300, Jorge Aldo G. de F. Junior jagf...@gmail.com wrote: no one explained so let me try : void ForwardModel::SetMixedBoundaryCondition(const int iElec, void somefunction means its a pascal procedure const double* SX0, const has the same effect as fpc const