Implement a method using a function value in Scala -


Is the implementation of the method possible by using the function object / value? I would like to write something in the spirit of this:

  abstract class A {def f (x: int): int} extension of class B A {f = identity}  

and supplement and, here's another:

  abstract class A {def F: (Int) = & gt; Int} class B extends A {val f = identification}} is expanded in class C. {def f = identity}} is expanded in class D {def f = (x: int) => -x}  

If you are connected to a normal DF, then you can do the best

  abstract class z {def f (x: Int): int} square y extension z {def f (x: int) = detection (x)}  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -