Hi Jens --
From my perspective, a variable of class type in C++ is most like a C
struct/Chapel record; the thing in C++ which is more like a variable of
class type in Java is a pointer to a variable of class type (i.e., that's
how you get dynamic dispatch and references to objects rather than the
objects themselves).
In terms of code, the following in C++:
class C {
int x;
};
C myC;
is more similar to the following record in Chapel:
record C {
var x: int;
}
var myC: C;
than it is to the following class in Chapel:
class C {
var x: int;
}
var myC: C;
which in turn is more similar to the following pointer-to-class in C++:
class C {
int x;
};
C* myC = NULL;
or the following class in Java:
class C {
int x;
}
C myC;
I'm far from an OOP (or Java, for that matter) expert, though, so if you
(or anyone reading this far) think I'm off-base in this, please feel free
to let me know.
-Brad
On Fri, 2 Sep 2016, Jens Breitbart wrote:
Hi Brad —
Am 30.08.2016 um 00:42 schrieb Brad Chamberlain <[email protected]>:
* generally, when we say "similar to classes in Java", this should be
interpreted in a very general sense (e.g., "as opposed to classes in
C++") rather than a statement that our goal is to support the same
feature set as Java and/or in the same way.
I am curious, what are the differences between Java and C++ classes in a
general sense? Sorry, but from my point of view there are hardly any
differences (in a general sense, there are obviously various difference when
you look into the details).
-Jens
------------------------------------------------------------------------------
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users