scala - Passing a method as argument without converting it to a Function -
i've read here difference between functions , methods in scala. says methods can faster functions. when passing method m
argument using m _
, m implicitly converted function.
- is performance difference significant enough ponder avoiding functions when going bottleneck in program?
- is there way pass method argument without converting function?
kind of irrelevant 2. in general, forget performance, methods more readable function declarations. might little faster in situations compiler optimizations, but:
you cannot pass method argument without converting function. method special language construct, , not object itself. must use eta-expansion convert 1 if want use object.
Comments
Post a Comment