I'm looking to identify the term for something, wh...
# announcements
h
I'm looking to identify the term for something, what do you call it in kotlin when you invoke a method through the class while passing the
this
argument explicitly as in
(String::take)("hello", 3)
or even, what you call the
String::take
part?
f
http://kotlinlang.org/docs/reference/reflection.html#function-references String::take is a function reference to the function take on the class String. The second parentheses ("hello", 3) is you actually invoking that function you are referencing. Not sure what you mean by passing this in this case.
h
for example, python would call this an "unbound method" with
str.upper
, c++ the closest would be "pointer-to-member" with
std::string::size
I'm just looking for the name you'd use for
String::take
in this example, is there not one more specific than it being a function reference?
c
String::take
is function reference,
(String::take)("hello", 3)
is invoking function by reference (probably) 🙂