Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Freeing items form dyn. array before deleting

  1. #11

    Freeing items form dyn. array before deleting

    Quote Originally Posted by chronozphere
    huh?... i've never seen that before.
    Are objects like records/structs or more like classes? What are the differences? :?
    Objects are obsolete and shouldn't be used anymore. Well, the difference between records and objects is that objects can have methods, while records cannot. That's all.

  2. #12

    Freeing items form dyn. array before deleting

    Quote Originally Posted by Brainer
    Objects are obsolete and shouldn't be used anymore. Well, the difference between records and objects is that objects can have methods, while records cannot. That's all.
    In D2006+ records can contain methods can (.NETism needed for for..each), and in FPC objects are not formally deprecated.

    However, except some really rare cases (e.g. emulation of statically allocated iterator objects is one), one should indeed use classes.

  3. #13

    Freeing items form dyn. array before deleting

    Quote Originally Posted by Brainer
    Quote Originally Posted by chronozphere
    huh?... i've never seen that before.
    Are objects like records/structs or more like classes? What are the differences? :?
    Objects are obsolete and shouldn't be used anymore. Well, the difference between records and objects is that objects can have methods, while records cannot. That's all.
    That's why I use Objects. They must not be removed from Pascal, they have to be there because of backwards compat.
    Marmin^.Style

  4. #14

    Freeing items form dyn. array before deleting

    Quote Originally Posted by marcov
    In D2006+ records can contain methods can (.NETism needed for for..each)
    Hmm, I'm not that sure. :? I think they can only contain methods related to operator overriding. Correct me if I'm wrong.

  5. #15

    Freeing items form dyn. array before deleting

    Quote Originally Posted by Brainer
    Quote Originally Posted by marcov
    In D2006+ records can contain methods can (.NETism needed for for..each)
    Hmm, I'm not that sure. :? I think they can only contain methods related to operator overriding. Correct me if I'm wrong.
    no they may have functions, constructors, procedures, but not destructors
    From brazil (:

    Pascal pownz!

  6. #16

    Freeing items form dyn. array before deleting

    Quote Originally Posted by arthurprs
    no they may have functions, constructors, procedures, but not destructors
    I don't get it then. Why does Borland say objects are obsolete, while they allowed records to have its own functions and even a constructor?

  7. #17

    Freeing items form dyn. array before deleting

    Is there any reason i should use records if objects do same and can have procedures? Is object packed?

  8. #18

    Freeing items form dyn. array before deleting

    Quote Originally Posted by Brainer
    Quote Originally Posted by arthurprs
    no they may have functions, constructors, procedures, but not destructors
    I don't get it then. Why does Borland say objects are obsolete, while they allowed records to have its own functions and even a constructor?
    don't know =|
    From brazil (:

    Pascal pownz!

  9. #19

    Freeing items form dyn. array before deleting

    Records with methods are nice in the sense that no advanced memory management is required to chug it around at random places in ram. Objects contain certain type information to my knowledge. The compiler will also place helper functions for objects to allocate and free objects and such

    I can only wait for FPC to add similar functionality
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

Page 2 of 2 FirstFirst 12

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
  •