Re: C++/CLI is the way to go

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Barry Kelly wrote:
Andre Kaufmann wrote:

3) ! The killer argument ;-9

Delphi implements reference counted objects. InterfacedObjects

AFAIK this Delphi code
compiles directly without a modification
to .NET 1.1 ? How can this be ?

Delphi .NET interfaces aren't ref-counted. In fact, this can be
compatibility problem.

Agreed. Just checked the compiled code in BDS 2006. The TInterfaced object is implemented empty, without functions, with a note IInterface is handled differently, I'll have to dig deeper how it's handled next week. So far to the mystery that nearly everything compiles to .NET seamlessly.
I just wonder why I haven't heard about that portability issue in the newsgroups.

Even if they were ref-counted in Delphi .NET, Delphi can't control what
other languages do with the references.

Agreed. The same problem2 you are facing if you are using COM objects in ..NET.

The same problem occurs in any
language that targets the CLR: you can only add these kinds of features,
features which expect all other users to play along, either to the core
CLR, or make that portion of the language incompatible with other CLR
languages.

Yes. I would perhaps prefer going on without reference count support,
than using an incompatible CLR.

Well I perhaps can live with the manual SmartPointer:

SmartPointer<O> p =
new SmartPointer<O>(otherSmartPointer); // Increase reference

...... do something with

p.Dispose(); // Decrease reference and Dispose held object if zero

That's always possible.
And compatible with all .NET languages ;-)

-- Barry

Andre
.



Relevant Pages

  • Re: Basic inheritance question
    ... Where is the "explicit calling of class name" exactly? ... which in python is generally called "self". ... reference to the current instance is to pass it as an argument to the ... BadThingwrt/ readbility, specially with multiparadigm languages ...
    (comp.lang.python)
  • Re: A taxonomy of types
    ... Before a representation is practical I think we need a taxonomy (so we ... dynamic typing or type inference and most languages have rules ... Target domain of reference ... Sequence of component types and names ...
    (comp.lang.misc)
  • Re: Basic inheritance question
    ... Old Java habits die slowly. ... No, seriously it isn't Java habits only, most other languages wouldn't ... That's not very far from what a Python method object does - ... reference to the current instance is to pass it as an argument to the ...
    (comp.lang.python)
  • Re: Newlisp?
    ... > Those notions do not describe if first class objects of a language are ... > passed by value or by reference. ... In Perl a variable contains a scalar (string or pointer), ... In almost all other languages a variable always points to an object, ...
    (comp.lang.lisp)
  • Re: How come Ada isnt more popular?
    ... Represnattion sharing needs either reference counting ... They share representation in the underlying system / VM / whatever you ... Now a function of the first tree is evaluated, ... In pure functional languages nothing "changes". ...
    (comp.lang.ada)