learn grammer of function in scala