0

In Java, we can do something like this:

ObservableStringValue str = ...;
Binding<Integer> strLen = EasyBind.map(str, String::length);

Where String::length effectively is an instance method being used as a function. Is there an equivalent form in Scala? (And by extension, an equivalent way to use EasyBind in Scala)

Miss Chanandler Bong
  • 4,081
  • 10
  • 26
  • 36
Benedict Lee
  • 714
  • 8
  • 21
  • Also relevant: [Detach a method](http://stackoverflow.com/a/13473363/2988), [Difference between method and function in Scala](http://stackoverflow.com/q/2529184/2988), and [Scala: Referencing functions on object instances](http://stackoverflow.com/q/18899595/2988), among many many others. – Jörg W Mittag Jul 06 '15 at 08:29

1 Answers1

0
scala> "dsfs".toString _
res1: () => String = <function0>
Waldemar Wosiński
  • 1,490
  • 17
  • 28