cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding this line from vanilla tick set up

Mannix
New Contributor III
New Contributor III

I'm wondering what this part of the line, it is a conditional does: not min(`time`sym~2#key flip value@)each t

In particular why there is an @ Appy here?

2 ACCEPTED SOLUTIONS

matt_moore
New Contributor III

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 

View solution in original post

SJT
Valued Contributor
Valued Contributor

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

 

View solution in original post

2 REPLIES 2

matt_moore
New Contributor III

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 

SJT
Valued Contributor
Valued Contributor

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