Board index » delphi » Re: Why no language improvements?

Re: Why no language improvements?


2005-03-09 05:29:18 AM
delphi46
Rudy Velthuis [TeamB] writes:
Quote

They are both just tables of virtual methods.
Actually, no. An interface isn't that. it is nothing really. When
coupled with an implementing class, /then/ it has a VMT.
Quote
The fact that Delphi treats them differently is the only technical
difference.
Right, that was my point all along.
--
Nick Hodges -- TeamB
Lemanix Corporation -- www.lemanix.com
Read my Blog -- www.lemanix.com/nick
 
 

Re: Why no language improvements?

Chris Uzdavinis (TeamB) writes:
Quote
Now you're doing the +ACI- decorations too. Ack!
Jeez, what a pain.
Back to US ASCII for me.
--
Nick Hodges -- TeamB
Lemanix Corporation -- www.lemanix.com
Read my Blog -- www.lemanix.com/nick
 

Re: Why no language improvements?

Chris Uzdavinis (TeamB) writes:
Quote
"Rudy Velthuis [TeamB]" <XXXX@XXXXX.COM>writes:

>Win32, interfaces (functioning like smart pointers) help you with
>the +ACI-leaving scope+ACI- issue.
>
>Even stack based +ACI-object+ACI--style objects are not destructed
>when they leave scope.

Now you're doing the +ACI- decorations too. Ack!
Something set my charset to utf-7.
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"Who the hell wants to hear actors talk?"
-- H. M. Warner (1881-1958), founder of Warner Brothers, in 1927
 

Re: Why no language improvements?

Rudy Velthuis +AFs-TeamB+AF0- writes:
+AD4- Object types?
No, stack based objects.
--
Nick Hodges -- TeamB
Lemanix Corporation -- www.lemanix.com
Read my Blog -- www.lemanix.com/nick
 

Re: Why no language improvements?

Nick Hodges [TeamB] writes:
Quote
Rudy Velthuis [TeamB] writes:

>
>They are both just tables of virtual methods.

Actually, no. An interface isn't that. it is nothing really.
Since it has RTTI, it can not be nothing. It is a VMT alright, even if it
is not implemented.
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"If FORTRAN has been called an infantile disorder, then PL/I must be
classified as a fatal disease." -- Edsger Dijkstra
 

Re: Why no language improvements?

Rudy Velthuis [TeamB] writes:
Quote
Since it has RTTI, it can not be nothing.
Not by default, it doesn't.
--
Nick Hodges -- TeamB
Lemanix Corporation -- www.lemanix.com
Read my Blog -- www.lemanix.com/nick
 

Re: Why no language improvements?

Nick Hodges +AFs-TeamB+AF0- writes:
+AD4- Rudy Velthuis +AFs-TeamB+AF0- writes:
+AD4-
+AD4- +AD4- Object types?
+AD4-
+AD4- No, stack based objects.
There are no stack based objects in Delphi for .NET, AFAIK.
--
Rudy Velthuis +AFs-TeamB+AF0- rvelthuis.bei.t-online.de
+ACI-My advice to you is get married: if you find a good wife you will be
happy+ADs- if not, you will become a philosopher.+ACI- -- Socrates.
 

Re: Why no language improvements?

"Mike Margerum" <XXXX@XXXXX.COM>writes
Quote
As far as i can tell your distinction is that delphi interfaces have to be
implemented and are reference counted.

C++ abstract classes dont have to be implemented if you use templates.
I imagine C++ compilers nowadays have overcome this problem, but I remember
when it was a no-no to try and instantiate a template using an abstract
class, because it would cause the compiler to go bonkers and instantiate
twenty zillion unique versions of the template, one for each class that
descended from that base class. There was even a name for this phenomenon,
but I can not remember it.
Quote

so cant I implement reference counting in a C++ abstract class?
Maybe in a descendent, but obviously you can not implement it in a pure
abstract class.
Quote

doesnt this make interfaces a subset of abstract classes?
It is more like the other way, where a pure abstract class is a degenerate
form of an interface.
This discussion between you and Nick is a classic case of miscommunication.
He doesn't really know C++ and you don't seem to really know Delphi, but
each is arguing about both.
 

Re: Why no language improvements?

Nick Hodges [TeamB] writes:
Quote
Rudy Velthuis [TeamB] writes:

>Since it has RTTI, it can not be nothing.

Not by default, it doesn't.
Neither does an abstract class, by default.
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"A child of five could understand this. Fetch me a child of five."
-- Groucho Marx
 

Re: Why no language improvements?

Nick Hodges [TeamB] writes:
Quote
I don't get it. Someone has been saying that C++ is evolving and that
Delphi is stagnant. Hmm. It appears that the exact opposite is true.
I'll say it again-- Delphi is *catching* *up*. C++ doesn't need to
evolve in so far as it is compared to Pascal because C++ is pretty far
ahead of Pascal (though Pascal has made strides lately).
Will
--
Want native support in Delphi for AMD64/EM64T? Vote here--
qc.borland.com/wc/qcmain.aspx
 

Re: Why no language improvements?

"Mike Margerum" <XXXX@XXXXX.COM>writes
Quote
>>which is also why delphi will probrably never have stack based
>>objects.
>

Yeh i know about Object. What I was getting at is that you will never
have TObject descendants on the stack.
That is not quite correct, in terms of what the code does. You can get the
same result in Delphi by using an TObject that implements a reference
counted interface as you can by using an object declared on the stack in
C++. Delphi doesn't need stack-based objects because it has reference
counted interfaces, which get destroyed when they go out of scope just like
stack-based objects in C++.
 

Re: Why no language improvements?

Craig Stuntz [TeamB] writes:
Quote
The one thing I wish they had done is eliminated the support for /
calls to _AddRef and _Release when IInterface was introduced as the
top of the heirarchy (it used to be IUnknown, which is now an alias).
I would have preferred that Borland kept _AddRef and _Release on
IUnknown and made it a subclass of IInterface.
I almost opened that report while I was sysop'ing on QC today, but I
decided to keep away for the most controversial ones, for now.
--
Leonel
 

Re: Why no language improvements?

John Jacobson writes:
Quote
Maybe in a descendent, but obviously you can not implement it in a pure
abstract class.
Well, ot be honest, it is not implemented in interfaces either. It is
implemented in the runtime, which treats interfaces differently.
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"Argue for your limitations, and sure enough they're yours."
- Richard Bach
 

Re: Why no language improvements?

"Mike Margerum" <XXXX@XXXXX.COM>writes
Quote
I wasnt indicating delphi didnt have abstract classes.

Interfaces are a subset of abstract classes. more clear? I can build an
abstract class with reference counting semantics.
And you can build an interface without reference-counting semantics.
 

Re: Why no language improvements?

"Mike Margerum" <XXXX@XXXXX.COM>writes
Quote
>In Delphi, it is well possible (using virtual functions) to access
>parts of a class that are not initiliazed yet. In C, this is
>impossible. In Delphi, you must be aware that some parts of a class may
>not be constructed yet, and code accordingly.
>
>

which is also why delphi will probrably never have stack based objects.
I don't see how that logically follows at all. Especially since Delphi
objects that instantiate a reference-counted interface act just like
stack-based objects anyway.