is it possible to set a function as being a functi...
# announcements
a
is it possible to set a function as being a function of some other variable? e.g.
class A { val x = X(); fun foo(some: Bar) = x::anotherFooAlsoAcceptingOneBar; }
g
I think you can do this:
Copy code
class A {
        val x = X()
        val foo = x::anotherFooAlsoAcceptingOneBar
    }
A.foo is a function and called in the usual way.
And A.foo has the same signature as X.anotherFooAlsoAcceptingOneBar