# Function value definition question

**URL:** <https://users.scala-lang.org/t/function-value-definition-question/8143>\
**Category:** Question\
**Created:** [January 26, 2022, 2:19am UTC](https://users.scala-lang.org/t/function-value-definition-question/8143 "2022-01-26T02:19:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pengyh](https://users.scala-lang.org/user_avatar/users.scala-lang.org/pengyh/32/2147_2.png) [@pengyh](https://users.scala-lang.org/u/pengyh)\
**Post date:** [January 26, 2022, 2:19am UTC](https://users.scala-lang.org/t/function-value-definition-question/8143/1 "2022-01-26T02:19:22Z")

</div>

I know this works:

```auto
scala> val f9:String => String => String = x => y => x+y
val f9: String => (String => String) = $Lambda$1199/0x000000084066c040@3babb257

```

And this works:

```auto
scala> val f9:(String,String) => String = (x,y) => x+y
val f9: (String, String) => String = $Lambda$1208/0x000000084067f040@66ff37ff

```

I tried to write with another form:

```auto
scala> val f10:(String)(String) => String = (x)(y) => x+y
                       ^
       error: ';' expected but '(' found.

```

This doesnt work.

I just want to define a function value for this kind:

```auto
scala> def mytest(x:String)(y:String) = x+y
def mytest(x: String)(y: String): String

scala> mytest("hi ")("world")
val res25: String = hi world

```

Can you help?  
Thanks & regards

---

<div class="post-metadata">

**Author:** ![BalmungSan](https://users.scala-lang.org/user_avatar/users.scala-lang.org/balmungsan/32/1700_2.png) [@BalmungSan](https://users.scala-lang.org/u/BalmungSan)\
**Post date:** [January 26, 2022, 4:47am UTC](https://users.scala-lang.org/t/function-value-definition-question/8143/2 "2022-01-26T04:47:22Z")

</div>

Remember that [functions and methods are not the same](https://docs.scala-lang.org/tutorials/FAQ/index.html#whats-the-difference-between-methods-and-functions)

Multiple argument lists are a feature of methods alone, for functions you need to do what you already show in your first example, a function that returns another function.

In any case, you usually don’t need to manipulate raw functions except for lambda literals. Rather use methods and leave eta-expansion to turn them into functions when required.
