Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- KX Community
- :
- Discussion Forums
- :
- KX Academy
- :
- Understanding this line from vanilla tick set up

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2022.03.15 02:35 PM

In particular why there is an @ Appy here?

2 ACCEPTED SOLUTIONS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2022.03.15 03:22 PM - edited 2022.03.16 04:08 AM

It's creating a unary projection / composition for the part in brackets, could achieve the same with a lamda function:

```
q)(`time`sym~2#key flip value@)
~[`time`sym]#[2]!+@[.:]
q)(`time`sym~2#key flip value@) each t
110b
q){`time`sym~2#key flip value x} each t
110b
```

* there is an overhead with using lambdas so in tick it's preferred to be as efficient as possible

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2022.03.16 04:01 AM

Where `u`

, `v`

, `w`

, etc. are unaries then `u v w@`

is a unary composition equivalent to `{u v w x}`

.

In this case two of the five unaries are projections. A little spacing clarifies:

`(`time`sym~ 2# key flip value@) each t`

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2022.03.15 03:22 PM - edited 2022.03.16 04:08 AM

It's creating a unary projection / composition for the part in brackets, could achieve the same with a lamda function:

```
q)(`time`sym~2#key flip value@)
~[`time`sym]#[2]!+@[.:]
q)(`time`sym~2#key flip value@) each t
110b
q){`time`sym~2#key flip value x} each t
110b
```

* there is an overhead with using lambdas so in tick it's preferred to be as efficient as possible

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2022.03.16 04:01 AM

Where `u`

, `v`

, `w`

, etc. are unaries then `u v w@`

is a unary composition equivalent to `{u v w x}`

.

In this case two of the five unaries are projections. A little spacing clarifies:

`(`time`sym~ 2# key flip value@) each t`

Main Office Contacts

**EMEA**

Tel: +44 (0)28 3025 2242

**AMERICAS**

Tel: +1 (212) 447 6700

**APAC**

Tel: +61 (0)2 9236 5700

Useful Information

Popular Links

Follow Us

KX. All Rights Reserved.

KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.