# May I know how this syntax work please? h&quot;.z.pg:{.Q.trp\[(0;)@value@;x;{(1;.Q.sbt y)}\]}&quot;

**URL:** <https://forum.kx.com/t/may-i-know-how-this-syntax-work-please-h-quot-z-pg-q-trp-0-value-x-1-q-sbt-y-quot/12912>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [June 25, 2023, 8:49am UTC](https://forum.kx.com/t/may-i-know-how-this-syntax-work-please-h-quot-z-pg-q-trp-0-value-x-1-q-sbt-y-quot/12912 "2023-06-25T08:49:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdb\_newbie1](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@kdb\_newbie1](https://forum.kx.com/u/kdb_newbie1)\
**Post date:** [June 25, 2023, 8:49am UTC](https://forum.kx.com/t/may-i-know-how-this-syntax-work-please-h-quot-z-pg-q-trp-0-value-x-1-q-sbt-y-quot/12912/1 "2023-06-25T08:49:00Z")

</div>

h".z.pg:{.Q.trp[(0;)@value@;x;{(1;.Q.sbt y)}]}"

.z.pg is the message handler on the server&nbsp;

.Q.trp takes 3 arguments:

#1 the function: (0;)@value@ (the default value of .z.pg is just {value x}, how does this translate to that?)  
#2 Argument: x (which is the user query)  
#3 The binary function where x is the error string and y is the backtracing object&nbsp;

And why cannot we simply do this:&nbsp;h".z.pg:{.Q.trp[{value x};x;{(1;.Q.sbt y)}]}"  
Thank you for all the help!&nbsp;

---

<div class="post-metadata">

**Author:** ![gyorokpeter-kx1](https://avatars.discourse-cdn.com/v4/letter/g/d26b3c/32.png) [@gyorokpeter-kx1](https://forum.kx.com/u/gyorokpeter-kx1)\
**Post date:** [June 25, 2023, 12:00pm UTC](https://forum.kx.com/t/may-i-know-how-this-syntax-work-please-h-quot-z-pg-q-trp-0-value-x-1-q-sbt-y-quot/12912/2 "2023-06-25T12:00:00Z")

</div>

```
.Q.trp[(0;)@value@;x;{(1;.Q.sbt y)}]

```

means roughly the same as

.Q.trp[{(0;value x)};x;{(1;.Q.sbt y)}]

The only difference is that the second form uses a lambda, which appears as an additional level in the stack trace.

The&nbsp;@ at the end of an expression forces it to be a projection (since it’s a binary operator and we haven’t given it a right argument). But in order to compose this with the (0;) operation (which puts the result in the 2nd element of the list) we need to include another&nbsp;@ otherwise we would be composing the wrong functions.

.Q.trp[{value x};x;{(1;.Q.sbt y)}] works but it returns a different value in the success case (just the value instead of a list).
