Scala: pass Seq to var-args functions -


given function takes variable number of arguments, e.g.

def foo(os: string*) =   println(os.tolist) 

how can pass sequence of arguments function? write:

val args = seq("hi", "there") foo(args) 

obviously, not work.

foo(args:_*) trick. instead of applying sequence 1 single argument, each element in sequence used argument.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -