# Are functions with general arguments possible?

**URL:** <https://community.freefem.org/t/are-functions-with-general-arguments-possible/383>\
**Category:** General Discussion\
**Created:** [May 2, 2020, 8:44pm UTC](https://community.freefem.org/t/are-functions-with-general-arguments-possible/383 "2020-05-02T20:44:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amtravco](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@amtravco](https://community.freefem.org/u/amtravco)\
**Post date:** [May 2, 2020, 8:44pm UTC](https://community.freefem.org/t/are-functions-with-general-arguments-possible/383/1 "2020-05-02T20:44:18Z")

</div>

Is there a way to write a function equivalent to

f(a, b) = a_x + b_y

where a, b are local variables to the function and x, y, the built in current-point variables?

Thus f(3, 5) would return 3_x + 5_y, with x, y having whatever their currents values are.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [May 3, 2020, 7:59am UTC](https://community.freefem.org/t/are-functions-with-general-arguments-possible/383/2 "2020-05-03T07:59:55Z")

</div>

```auto
func real f(real a, real b) {
    return a * x + b * y;
}
mesh Th = square(10, 10);
fespace Vh(Th, P1);
Vh u = f(3, 5);
plot(u);

```
