scala - Converting this function to anonymous function -


how create function returns true if number 5 anonymous function:

def yeah_five(p: int): boolean = p == 5 

thanks?

short notation anonymous functions:

(p: int) => (p == 5); 

long version:

new function1[int] {   def apply(p: int): int = p == 5 } 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

php - HTTP_REFERER woes: How can I allow access to a specific page, only when a visitor has visited another specific page beforehand? -

java Extracting Zip file -