https://kotlinlang.org logo
#feed
Title
# feed
c

cedric

11/09/2017, 6:46 AM
@Marcin This is incorrect:
The Box is a class, while Box<Int>, Box<A>, Box<List<String>> are types generated by generic class Box
Box
is not a class, it's a type constructor.
Box<Int>
is a class. Also, types are usually the global name used to denote a structure, e.g. an interface, a class, a trait, etc... I feel you made up your own meaning for these terms in the sentence i quoted.
🧵 1
v

voddan

11/09/2017, 7:46 AM
@cedric are you sure that
Box<Int>
is a class? In C++ I would totally agree with you (
Box<T>
is a template there), but on JVM a class is something that has a class object (that thing that contains static fields and the method table), so
Box
must be a class, and
Box<Int>
is a compile-time type on top of that class
☝️ 3
It is coincidence that there is also
Box
xD
Box
to generic class, and
Box<Integer>
is generic type.
I don't know how it is defined in C++. Terms and definitions comes from category theory, but there are some different nomenclatures in different languages. For JVM I am quite sure that it is correct while it is hard to argue with Java docs.
v

voddan

11/09/2017, 4:07 PM
it is correct
Which point of view do you support?
m

marcinmoskala

11/10/2017, 6:44 AM
@voddan I meant my article, but I think that your answer is also correct
👌 1