# Peach for multi-argument functions

**URL:** <https://forum.kx.com/t/peach-for-multi-argument-functions/10486>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [October 4, 2015, 3:14am UTC](https://forum.kx.com/t/peach-for-multi-argument-functions/10486 "2015-10-04T03:14:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KdbNoob](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@KdbNoob](https://forum.kx.com/u/KdbNoob)\
**Post date:** [October 4, 2015, 3:14am UTC](https://forum.kx.com/t/peach-for-multi-argument-functions/10486/1 "2015-10-04T03:14:00Z")

</div>

I can do&nbsp;

f each argLIst&nbsp;

I can also do&nbsp;

f peach argList&nbsp;

If function g takes two argument, I can do g’[a1;a2]

but how do I run g with peach on a1, a2?&nbsp;

---

<div class="post-metadata">

**Author:** ![manni\_patel](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@manni\_patel](https://forum.kx.com/u/manni_patel)\
**Post date:** [October 4, 2015, 10:50am UTC](https://forum.kx.com/t/peach-for-multi-argument-functions/10486/2 "2015-10-04T10:50:00Z")

</div>

The easiest thing to do is pass (a1;a2) as a single parameter into f, and have f access them as x[0] and x[1]

{ //use x[0] and x[1] here} peach ((a1;a2);(b1;b2))

---

<div class="post-metadata">

**Author:** ![Aaron\_Davies](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Aaron\_Davies](https://forum.kx.com/u/Aaron_Davies)\
**Post date:** [October 20, 2015, 4:23am UTC](https://forum.kx.com/t/peach-for-multi-argument-functions/10486/3 "2015-10-20T04:23:00Z")

</div>

q)g:{x+y}

q)1 2 g’3 4

4 6

q)(g .)each(1 3;2 4)

4 6

q)(g .)peach(1 3;2 4)

4 6

q)
