Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread Graeme Geldenhuys

On 5/21/07, Flávio Etrusco [EMAIL PROTECTED] wrote:


Delphi documentation always stated it was a compatibility feature with
TP and should not be used for new code, IIRC even in Delphi 1... So,
even though I'm an optimization-addicted I presumed it was probably
under-maintained and under-optimized so I never even tried it :-/


And then 9 versions later it is suddenly a new language feature again!
How funny is that! :-)


--
Graeme Geldenhuys

General error, hit any user to continue.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread Graeme Geldenhuys

On 5/21/07, Flávio Etrusco [EMAIL PROTECTED] wrote:

 One thing I dislike is the poor abstract implementation. I don't see
 one good reason to let abstract class be instantiated...


Totally agreed.


Same here... it makes no sense.


And I'd like it so much if FPC would allow one to declare a class
'abstract' even if it didn't contain abstract methods...


What to start the age old debate about Interfaces vs Abstract Classes?  ;-)

--
Graeme Geldenhuys

General error, hit any user to continue.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread Sam Liddicott
* Flávio Etrusco wrote, On 21/05/07 22:44:
 On 5/21/07, Lepidosteus [EMAIL PROTECTED] wrote:
 One thing I dislike is the poor abstract implementation. I don't see
 one good reason to let abstract class be instantiated...


 Totally agreed.
 And I'd like it so much if FPC would allow one to declare a class
 'abstract' even if it didn't contain abstract methods...

 Final methods and readonly/final members would also be sooo nice ;-)
They would be a wicket sin.

I had so much trouble in the Delphi 1 days because so many VCL methods
were needlessly declared private instead of protected.

I found hacks round it, of course, but the priorities of the
component-set developer often don't match those of the user who is also
a developer.  private and final are a usually poor substitute for
respect and good communication.

Sam

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread Marco van de Voort
On Mon, May 21, 2007 at 08:04:10PM +0200, Micha Nelissen wrote:
 Mattias Gaertner wrote:
  I'm curious:
  Was there any feature, that FPC implemented first and was
  reimplemented by Borland in the same way?
 
 Perhaps operator overloading and inline ? But I think those have a .net
 origin, not fpc, for Borland.

Straight overloading also afaik. 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread Marco van de Voort
On Mon, May 21, 2007 at 01:39:03PM +0200, Graeme Geldenhuys wrote:
 Here is some interesting Delphi features I found title: New since Delphi 
 7...
 Anybody interested in implementing a few. At least FPC and Lazarus
 beat them to a few of those!! :-)
 
 New IDE features since Delphi 7
 http://dn.codegear.com/article/34325
 
 New VCL feature since Delphi 7
 http://dn.codegear.com/article/34323
 
 New Delphi language features since Delphi 7...
 http://dn.codegear.com/article/34324


http://www.stack.nl/~marcov/delphilater.txt

sums up some IRC discussion about these URLS.

 Some just don't make sense like the Records with Methods in the
 language features. Why not just use a class?

Thorsten proposed that this could have to do something with limiting the
scope where to search for special functions that implement for..in syntax.

So that'd make it a sideproduct of for..in promoted to feature.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread Marco van de Voort
On Tue, May 22, 2007 at 02:27:32PM +0100, Sam Liddicott wrote:
 
 I had so much trouble in the Delphi 1 days because so many VCL methods
 were needlessly declared private instead of protected.
 
 I found hacks round it, of course, but the priorities of the
 component-set developer often don't match those of the user who is also
 a developer.  private and final are a usually poor substitute for
 respect and good communication.

Agree fully. Nobody can forsee each and every border condition how future
users can use code.

Jonas/Thorsten suggested sealed as a helper to signal the compiler
optimization options. (possibly because this is all .NET copying, and the
JIT must be more sparingly with time)

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread Lepidosteus

Can anyone briefly explains me what a class helper is ?

Wikipedia has been of no help, and everytime I search I end up with
java code sample ...

--
Vianney Devreese - Lepidosteus
http://lepidosteus.com

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread Flávio Etrusco

On 5/22/07, Lepidosteus [EMAIL PROTECTED] wrote:

Can anyone briefly explains me what a class helper is ?

Wikipedia has been of no help, and everytime I search I end up with
java code sample ...

--
Vianney Devreese - Lepidosteus
http://lepidosteus.com



In this case, did you find a java example or none at all? AFAIK class
helper is what MS calls partial classes. And also AFAIK .NET is the
only major platform to support it. And I don't remember any example of
usage :-$

-Flávio

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread zaher dirkey

Can anyone briefly explains me what a class helper is

I think
class helper it some functions/procedures take the first params as the class
(that you want to make helper for it), but the fist param (the class) passed
as Class of this method.

function (MyClass:TMyClass; param2:TParam2);

but you can use it as

MyClass.function (param2:TParam2);

Nothing else, so it make as class helper as mentioned in the help of Delphi,
it is not multi inheritance.


Re: [lazarus] New features since Delphi 7...

2007-05-22 Thread Flávio Etrusco

On 5/22/07, Sam Liddicott [EMAIL PROTECTED] wrote:

* Flávio Etrusco wrote, On 21/05/07 22:44:
 On 5/21/07, Lepidosteus [EMAIL PROTECTED] wrote:
 One thing I dislike is the poor abstract implementation. I don't see
 one good reason to let abstract class be instantiated...


 Totally agreed.
 And I'd like it so much if FPC would allow one to declare a class
 'abstract' even if it didn't contain abstract methods...

 Final methods and readonly/final members would also be sooo nice ;-)
They would be a wicket sin.

I had so much trouble in the Delphi 1 days because so many VCL methods
were needlessly declared private instead of protected.

I found hacks round it, of course, but the priorities of the
component-set developer often don't match those of the user who is also
a developer.  private and final are a usually poor substitute for
respect and good communication.

Sam


Well, I guess maybe I should reply in private, but this way people
could think I agree on Sam's points, but it's not true and I hope my
opinion can be of some interest  ;-)

VCL is definitely an infuriating example of usage of visibility to
cripple functionality, but this is/was obviously a design decision and
not bugs.  IMO it was a way of giving out to the users the power of
having the source code but avoiding VCL being extended or modified in
ways Borland wouldn't like.
If not, they wouldn't have gone the great lengths they did to keep
people from recompiling the VCL (after changing any visibility they
wanted).

Visibility and mutability controls both have a big role in avoiding
several classes of programming errors, and anyway (their
non-existence) couldn't have helped a single bit against restricting
licenses.

But sure, I wouldn't oppose a compiler directive to enable some dirty
tricks against the 'private' visibility ;-)

Cheers,
Flávio

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] New features since Delphi 7...

2007-05-21 Thread Graeme Geldenhuys

Hi,

Here is some interesting Delphi features I found title: New since Delphi 7...
Anybody interested in implementing a few. At least FPC and Lazarus
beat them to a few of those!! :-)

New IDE features since Delphi 7
http://dn.codegear.com/article/34325

New VCL feature since Delphi 7
http://dn.codegear.com/article/34323

New Delphi language features since Delphi 7...
http://dn.codegear.com/article/34324


Some just don't make sense like the Records with Methods in the
language features. Why not just use a class?


--
Graeme Geldenhuys

General error, hit any user to continue.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Marc Weustink

Graeme Geldenhuys wrote:

Hi,

Here is some interesting Delphi features I found title: New since Delphi 
7...

Anybody interested in implementing a few. At least FPC and Lazarus
beat them to a few of those!! :-)

New IDE features since Delphi 7
http://dn.codegear.com/article/34325

New VCL feature since Delphi 7
http://dn.codegear.com/article/34323

New Delphi language features since Delphi 7...
http://dn.codegear.com/article/34324


Some just don't make sense like the Records with Methods in the
language features. Why not just use a class?


A class has some overhead, however an object with methods is pretty much 
the same


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Michael Van Canneyt


On Mon, 21 May 2007, Graeme Geldenhuys wrote:

 Hi,
 
 Here is some interesting Delphi features I found title: New since Delphi 7...
 Anybody interested in implementing a few. At least FPC and Lazarus
 beat them to a few of those!! :-)
 
 New IDE features since Delphi 7
 http://dn.codegear.com/article/34325
 
 New VCL feature since Delphi 7
 http://dn.codegear.com/article/34323
 
 New Delphi language features since Delphi 7...
 http://dn.codegear.com/article/34324
 
 
 Some just don't make sense like the Records with Methods in the
 language features. Why not just use a class?

Class has an implicit pointer. record doesn't.
But it already exists in FPC: an object (TP style). 
This IS a record with methods.

They just gave it a different name. Only god knows why...

Michael.

 
 
 -- 
 Graeme Geldenhuys
 
 General error, hit any user to continue.
 
 _
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives
 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Graeme Geldenhuys

On 5/21/07, Michael Van Canneyt [EMAIL PROTECTED] wrote:

Class has an implicit pointer. record doesn't.
But it already exists in FPC: an object (TP style).
This IS a record with methods.


Ah, so that is what a Object type is!  I always wondered, but never
did the trouble to read up on it. :-) Thanks Michael.


--
Graeme Geldenhuys

General error, hit any user to continue.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Marc Weustink

Graeme Geldenhuys wrote:

On 5/21/07, Michael Van Canneyt [EMAIL PROTECTED] wrote:

Class has an implicit pointer. record doesn't.
But it already exists in FPC: an object (TP style).
This IS a record with methods.


Ah, so that is what a Object type is!  I always wondered, but never
did the trouble to read up on it. :-) Thanks Michael.


IIRC, in delphi 1 you couldn't mix classes and objects in the same unit. 
So you wouldn't use them.


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Michael Van Canneyt


On Mon, 21 May 2007, Graeme Geldenhuys wrote:

 On 5/21/07, Marc Weustink [EMAIL PROTECTED] wrote:
 
  IIRC, in delphi 1 you couldn't mix classes and objects in the same unit.
  So you wouldn't use them.
 
 I've never used them before... :-)  Always thought they were the same
 as a Class but in the pre-Delphi days. 

That is more or less correct, but class implicitly assumes that you allocate
the object on the heap. With objects, you have the choice (and there is a rather
obscure syntax for dealing with that...)

 Thought they were deprecated or something.

They were. 
Although I think all versions of Delphi still can compile such code.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Marc Weustink

Michael Van Canneyt wrote:


On Mon, 21 May 2007, Graeme Geldenhuys wrote:


On 5/21/07, Marc Weustink [EMAIL PROTECTED] wrote:

IIRC, in delphi 1 you couldn't mix classes and objects in the same unit.
So you wouldn't use them.

I've never used them before... :-)  Always thought they were the same
as a Class but in the pre-Delphi days. 


That is more or less correct, but class implicitly assumes that you allocate
the object on the heap. With objects, you have the choice (and there is a rather
obscure syntax for dealing with that...)


Thought they were deprecated or something.


They were. 
Although I think all versions of Delphi still can compile such code.


The last time I tried (D6) it could.
IIRC, the problem was that you had to specify the class/object a 
class/object is derived from.


IE.
  TMyObject = object(TObject)
  TMyClass = class(TObject)

However here you get a name clash, since it TOjbect is different.

Marc


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Graeme Geldenhuys

On 5/21/07, Marc Weustink [EMAIL PROTECTED] wrote:

The last time I tried (D6) it could.
IIRC, the problem was that you had to specify the class/object a
class/object is derived from.

IE.
   TMyObject = object(TObject)
   TMyClass = class(TObject)

However here you get a name clash, since it TOjbect is different.


I think I'll stay with what I know... Class types!  :-)



--
Graeme Geldenhuys

General error, hit any user to continue.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Lepidosteus

One thing I dislike is the poor abstract implementation. I don't see
one good reason to let abstract class be instantiated...

As for records with methods, they are required for delphi.net

I think they have just translated it to native delphi

They seems to have their uses, following is a copy/paste from borland newsgroup:



Iain Macmillan [EMAIL PROTECTED] wrote

There are cases where a record is as good or better
than a class.  There are more cases where a record
with methods is as good or better than a class.
Well, there must be. Or why would Borland have
bothered to implement records with methods..


Iain,  You seem to be in doubt.  Records, especially
packed records, with methods are very different than
classes, when it comes to making the data content
persist over time or place.  I can think of several
important differences:
(1) Records can be packed into arrays in RAM or in
storage, and moved quickly between.
(2) Records need no appended pointer to a VMT or
appended length value.
(3) Stored records can be used, with programmer
care,  directly between different programs or
versions of the same program.
(4) Records may be more difficult to use than
class objects if the usage only within the same
program.
Rgds, JohnH

Yeah, there are plenty of cases where you don't need the ability to
override anything and you don't have the overhead of a class this way.

I still use the old OBJECT structure sometimes simply to get a record
with methods.


--
Vianney Devreese - Lepidosteus
http://lepidosteus.com

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Giulio Bernardi


New Delphi language features since Delphi 7...
http://dn.codegear.com/article/34324



Looking at the New language features page I thought about two things:
1) This is one that I sometimes need: class members (static members in java
IIRC), or class var - class property in the page provided.
Moreover, if we had class members we could get rid of a hack in LCL that 
till

now couldn't be solved in other ways (the fact that LCL classes store the
WSPrivate class in the AutoTable field of the class VMT, to overcome the
lack of class members in the language).

I don't know if class members are planned/implemented in 2.3.x, is there the
will to do such a thing?


2) I don't like that helper class thing very much: it smells bad, and it
was introduced by Borland to map VCL classes to standard .NET ones.
However, this feature could be used to clean another (actually, it's in the
same file) big hack in lcl: the fact that class hierarchy is altered at
runtime so that tws* methods map to twsWIDGETSET* methods.
I mean, without having to overwrite VMTs, something like this could be done
(if I understood correctly the semantics of helper classes):


TWSControl = class
..
end;


and, in the interface:

TWSWin32Control = class helper for TWSControl
..
end;

No more need for registering an interface at runtime, since using the main
interface units causes helper classes to be used: it would be a cleaner way
using a language supported construct instead of having to hack class 
structure

to make things work.
This thing was introduced by Borland to map VCL to .NET: well, in LCL we are
doing the same thing - mapping lcl classes to the right widgetset - so, even
if I don't like this helper class thing in everyday life, in the LCL case
one could use this feature for the same reason Borland introduced it.

However, I think that this language feature would be more difficult to
implement than class members, and rarely used (it's something that only
lazarus SHOULD need - you shouldn't use it in your programs).

bye,
Giulio 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread vsnijders


- Original Message -
From: Giulio Bernardi [EMAIL PROTECTED]
Date: Monday, May 21, 2007 6:16 pm
Subject: Re: [lazarus] New features since Delphi 7...

 
  New Delphi language features since Delphi 7...
  http://dn.codegear.com/article/34324
 
 
 Looking at the New language features page I thought about two 
 things:1) This is one that I sometimes need: class members (static 
 members in java
 IIRC), or class var - class property in the page provided.
 Moreover, if we had class members we could get rid of a hack in LCL 
 that 
 till
 now couldn't be solved in other ways (the fact that LCL classes 
 store the
 WSPrivate class in the AutoTable field of the class VMT, to 
 overcome the
 lack of class members in the language).
 
 I don't know if class members are planned/implemented in 2.3.x, is 
 there the
 will to do such a thing?
 
 
 2) I don't like that helper class thing very much: it smells bad, 
 and it
 was introduced by Borland to map VCL classes to standard .NET ones.
 However, this feature could be used to clean another (actually, 
 it's in the
 same file) big hack in lcl: the fact that class hierarchy is 
 altered at
 runtime so that tws* methods map to twsWIDGETSET* methods.
 I mean, without having to overwrite VMTs, something like this could 
 be done
 (if I understood correctly the semantics of helper classes):
 
 
 TWSControl = class
 ..
 end;
 
 
 and, in the interface:
 
 TWSWin32Control = class helper for TWSControl
 ..
 end;
 
 No more need for registering an interface at runtime, since using 
 the main
 interface units causes helper classes to be used: it would be a 
 cleaner way
 using a language supported construct instead of having to hack 
 class 
 structure
 to make things work.
 This thing was introduced by Borland to map VCL to .NET: well, in 
 LCL we are
 doing the same thing - mapping lcl classes to the right widgetset - 
 so, even
 if I don't like this helper class thing in everyday life, in the 
 LCL case
 one could use this feature for the same reason Borland introduced it.


I think, if we had designed this part of the widget interface for fpc 2.0.0 
(after 2005) instead of fpc 1.0.0 (+/- 2000), we would have used interfaces. 
Something like

IWSWinControl = interface(IWSControl)
  function CreateHandle(AWinControl: TWinControl): THandle;
end;

TWin32WinControl = class(TWin32Control, IWSWinControl)
  function CreateHandle(AWinControl: TWinControl): THandle;
end;
 
 However, I think that this language feature would be more difficult to
 implement than class members, and rarely used (it's something that 
 onlylazarus SHOULD need - you shouldn't use it in your programs).

Vincent

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Micha Nelissen
Mattias Gaertner wrote:
 I'm curious:
 Was there any feature, that FPC implemented first and was
 reimplemented by Borland in the same way?

Perhaps operator overloading and inline ? But I think those have a .net
origin, not fpc, for Borland.

Micha

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Alexsander Rosa

Some of these new IDE features are sweet!
http://dn.codegear.com/article/34323

2007/5/21, Graeme Geldenhuys [EMAIL PROTECTED]:

Hi,

Here is some interesting Delphi features I found title: New since Delphi 7...
Anybody interested in implementing a few. At least FPC and Lazarus
beat them to a few of those!! :-)

New IDE features since Delphi 7
http://dn.codegear.com/article/34325

New VCL feature since Delphi 7
http://dn.codegear.com/article/34323

New Delphi language features since Delphi 7...
http://dn.codegear.com/article/34324


Some just don't make sense like the Records with Methods in the
language features. Why not just use a class?


--
Graeme Geldenhuys

General error, hit any user to continue.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives




--
Atenciosamente,

Alexsander da Rosa
http://alexrosa.blogspot.com - Blog Pessoal
http://www.pliber.org - Partido Libertário

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Graeme Geldenhuys

On 5/21/07, Mattias Gaertner [EMAIL PROTECTED] wrote:

 They just gave it a different name. Only god knows why...

I'm curious:
Was there any feature, that FPC implemented first and was
reimplemented by Borland in the same way?


Can we take them to court for Patent Infringement or ask them for royalties.
Better yet, they must donate a few staff members to permanently work
on FPC  Lazarus.

How sweet would that be!  ;-)



--
Graeme Geldenhuys

General error, hit any user to continue.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Lee Jenkins

Graeme Geldenhuys wrote:

Hi,

Here is some interesting Delphi features I found title: New since Delphi 


New Delphi language features since Delphi 7...
http://dn.codegear.com/article/34324



Would anyone mind explaining this to me?  I don't get it.

 Routines can now be marked with the inline directive.  This tells the 
compiler that, instead of actually calling the routine, it should emit 
code that includes the routine at the call site.



Sorry, but the only thing that kept me out of college...was highschool. ;)



--

Warm Regards,

Lee



_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Graeme Geldenhuys

On 5/21/07, Lee Jenkins [EMAIL PROTECTED] wrote:


Would anyone mind explaining this to me?  I don't get it.

 Routines can now be marked with the inline directive.  This tells the
compiler that, instead of actually calling the routine, it should emit
code that includes the routine at the call site.



As far as I understand it (FPC also has that feature) is that it is a
hint to the compiler for optimisation purposes.


--
Graeme Geldenhuys

General error, hit any user to continue.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Micha Nelissen
Lee Jenkins wrote:
  Routines can now be marked with the inline directive.  This tells the
 compiler that, instead of actually calling the routine, it should emit
 code that includes the routine at the call site.

http://en.wikipedia.org/wiki/Inline_expansion

Micha

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Michael Van Canneyt


On Mon, 21 May 2007, Graeme Geldenhuys wrote:

 On 5/21/07, Lee Jenkins [EMAIL PROTECTED] wrote:
 
  Would anyone mind explaining this to me?  I don't get it.
 
   Routines can now be marked with the inline directive.  This tells the
  compiler that, instead of actually calling the routine, it should emit
  code that includes the routine at the call site.
 
 
 As far as I understand it (FPC also has that feature) is that it is a
 hint to the compiler for optimisation purposes.

This is correct. Instead of inserting a call to the code of the routine, 
the generated assembler code for the routine is inserted at the location 
of the call. This is obviously only useful if the code of the routine
is small, and comparable to the overhead generated by the call 
(stack setup,call,stack cleanup).

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Flávio Etrusco

On 5/21/07, Graeme Geldenhuys [EMAIL PROTECTED] wrote:

On 5/21/07, Marc Weustink [EMAIL PROTECTED] wrote:

 IIRC, in delphi 1 you couldn't mix classes and objects in the same unit.
 So you wouldn't use them.

I've never used them before... :-)  Always thought they were the same
as a Class but in the pre-Delphi days. Thought they were deprecated or
something...


Delphi documentation always stated it was a compatibility feature with
TP and should not be used for new code, IIRC even in Delphi 1... So,
even though I'm an optimization-addicted I presumed it was probably
under-maintained and under-optimized so I never even tried it :-/


-Flávio

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Flávio Etrusco

On 5/21/07, Lepidosteus [EMAIL PROTECTED] wrote:

One thing I dislike is the poor abstract implementation. I don't see
one good reason to let abstract class be instantiated...



Totally agreed.
And I'd like it so much if FPC would allow one to declare a class
'abstract' even if it didn't contain abstract methods...

Final methods and readonly/final members would also be sooo nice ;-)

-Flávio

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] New features since Delphi 7...

2007-05-21 Thread Lee Jenkins

Micha Nelissen wrote:

Lee Jenkins wrote:

 Routines can now be marked with the inline directive.  This tells the
compiler that, instead of actually calling the routine, it should emit
code that includes the routine at the call site.


http://en.wikipedia.org/wiki/Inline_expansion



Neat.  Thanks all.

--

Warm Regards,

Lee



_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives