Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 35

Thread: New Delphi features since Delphi 7

  1. #11

    New Delphi features since Delphi 7

    records with methods are handy, the only thing I do not understand is why they are not inlined by the compiler when they are marked so....

  2. #12

    New Delphi features since Delphi 7

    The only useful addition I see is sealed classes/methods.
    Inlining of course useful as well, but it's not working in most important cases (assembler functions).

  3. #13

    New Delphi features since Delphi 7

    Yes, Records with Methods are basically classes. The difference is in the VMT and how its transported with the data-structures. Though, Records with Methods isn't anything new, its been around since records and method pointers existed . CG just made it "easier" to utilize.

    Personally, I'd be more interested in seeing the list of things that Borland (I can't say CG yet) screwed up or didn't do since Delphi 7 that the developers (users) strongly pushed for. This listing is greater in length then what they have done right overall.

    On the topic of CG, I see the same bad habits starting to show in CG as were found in early Borland. Bad marketing, poor target focus, and "new features" that were lightly requested if requested at all. I'll give credit where credit is due though, integrating FastMM and other freeware solutions into the distro with full native support was a good move.

  4. #14

    New Delphi features since Delphi 7

    Well, the difference between records with methods and classes is clear to me. What is absolutely not clear to me is the difference between objects and records with methods.

    About focus: CG has clearly started work on 64-bit and Unicode-VCL, and has been busy with Vista support too. This is a *lot* of work, it is too early to make conclusions here.

  5. #15

    New Delphi features since Delphi 7

    An object has a VMT (Virtual Method Table) so that all objects point to the same methods. Change the root method and you change it for all objects. In a record with methods there is no VMT thus the record contains a full copy of the method itself. Changing the method in one record does not affect the other records of the same type.

  6. #16

    New Delphi features since Delphi 7

    This is incorrect:
    [pascal]
    type t1=object
    a,b:word;
    end;
    [/pascal]

    ... is binary equivalent to:

    [pascal]
    type t1=record
    a,b:word;
    end;
    [/pascal]

    Only when you add a virtual method, a VMT is added to the object.

    I don't understand your reply about changing methods. How can you change a method in a running program?

  7. #17

    New Delphi features since Delphi 7

    You compared an orange to an orange since compilers are smart enough to optimize an object w/o any methods into a record. Compare it with a method in each and see if its the same. Unless something major has changed under the hood of Delphi then it shouldn't be.

    As for changing the method on the fly, you have to change the method pointer to point to a new method or walk the method pointer to the code block and overwrite that block with a new instruction set. Its true polymorphic development.

    I'm not going to get into exacts in this thread as its a complicated subject and is way off-topic.

  8. #18

    New Delphi features since Delphi 7

    Ahh great find! Those class helpers looks interesting.

    I've used operator overloading since I got Turbo Delphi and they are just so extremely nice. All my overloaded operators also work in fpc though.
    I for some reason like the delphi implementation better even though the fpc implementation seems more powerfull as it isn't only bound to be sitting in a record already

    Class properties are freaking nice. Now I can implement singletons without global variables
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  9. #19

    New Delphi features since Delphi 7

    Quote Originally Posted by JSoftware
    Class properties are freaking nice. Now I can implement singletons without global variables
    Do you mean static class properties?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  10. #20

    New Delphi features since Delphi 7

    No just class properties. These allow me to set a variable in all allocated classes of that type at one time.

    I haven't understood the difference between class property and the static class property. Could anyone elaborate?
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •