# Curious about this function design

**URL:** https://forum.kx.com/t/curious-about-this-function-design/7840
**Category:** Community Support
**Tags:** kdb-and-q
**Created:** [July 17, 2012, 2:04am UTC](https://forum.kx.com/t/curious-about-this-function-design/7840 "2012-07-17T02:04:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shewenhao](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@shewenhao](https://forum.kx.com/u/shewenhao)
#### Post date: [July 17, 2012, 2:04am UTC](https://forum.kx.com/t/curious-about-this-function-design/7840/1 "2012-07-17T02:04:00Z")

</div>

Dear All,

Thank you for your time.

I try to study the code on this website (http://eachright.blogspot.ch/2007/05/back-testing-in-q.html) which reveals a way to backtest a strategy.

Code is below:

As you can see in the sixth line there are f\_u and f\_l function definition. I am confused here.

Let have a look on f\_u definition:&nbsp;

f\_u:{[xe;limit;p;x]limit&x+xe\>p x};

But when the function has been used, it only has three arguments other than four arguments like this:

f\_u[(e\_pr+gep);i\_te;t`bid1]/[i\_eb];

May some one explain it to me? Thank you very much!

Best Regards,

Wenhao SHE

---

<div class="post-metadata">

### Author: ![nathan\_perrem1](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@nathan\_perrem1](https://forum.kx.com/u/nathan_perrem1)
#### Post date: [July 17, 2012, 2:13am UTC](https://forum.kx.com/t/curious-about-this-function-design/7840/2 "2012-07-17T02:13:00Z")

</div>

Wenhao,

f\_u[(e\_pr+gep);i\_te;t`bid1] is a projection which takes a single argument (monadic function)

This monadic function is then being executed with the over adverb “/” recursively over?i\_eb.

See scan and over adverb at code.kx:

?http://code.kx.com/wiki/Reference/Slash#over?

Regards,

Nathan

---

<div class="post-metadata">

### Author: ![shewenhao](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@shewenhao](https://forum.kx.com/u/shewenhao)
#### Post date: [July 25, 2012, 4:10pm UTC](https://forum.kx.com/t/curious-about-this-function-design/7840/3 "2012-07-25T16:10:00Z")

</div>

Thank you very much for your replay, Nathan,

It solved my problem and hope you have a nice day. Thank you for the link as well~~~
