I believe this is the way that `List` and `Mutable...
# getting-started
h
I believe this is the way that
List
and
MutableList
and the like are written in stdlib
r
No, it's not. A bit of advise: You may want to look up and verify such assumptions before you use them to make decisions.
s
You don’t happen to be basing this off of the
List() {}
and
MutableList() {}
functions, do you?
h
kind of
the main impetus was to allow for "sub" versions of the class i was writing to inherit all the functionality of the main version, but without being a full object, instead just containing pointers to the main object
s
List and MutableList are just interfaces though
h
yeah, and i was considering making my class just an interface
s
also, I mean, composition makes sense in a lot of cases
h
composition just gets messy when you're trying to generalize functions. Afaik, you have to create interfaces that describe the composition of every class, and the naming can get messy. it feels really bad to have to write something like:
fun <F: HasFoo> fooer(foo: F)
than
fun <F: Foo> fooer(foo: F)