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 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 := Max(k-band

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 does

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

2011-03-19 Thread Ingemar Ragnemalm
Jeppe Johansen 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 pascal translation

[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 wrote: >On Sat, Mar 19, 2011 at 06:07, Bo Berglund 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

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] Free Pascal 2.4.4 RC1 available

2011-03-19 Thread C Western
We have placed the first release-candidate of the Free Pascal Compiler version 2.4.4 on our ftp-servers. Please see . (I can't change the product version it apples to.) Colin ___ fpc-pascal maillist -

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 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) > > Now it s

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@lists.freepascal.

[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 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 converting to Pasca

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 beco

[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 expl

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 li

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 > exam

[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" 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 before