Can someone explain this k symbology of vs as
k){x:y}
Is : an adverb each left or something else ? reason its confusing is if its an adverb then where is the verb ?
Can someone explain this k symbology of vs as
k){x:y}
Is : an adverb each left or something else ? reason its confusing is if its an adverb then where is the verb ?
x is the verb - expressions with adverbs can have 1, 2 or more args. The 1 arg case is hidden in vs and sv for each-left/right but you can call it directly - (0b:)123. It seems though that all possible xs are hardcoded so 1 arg case is not a real adverb.
???, 26 ??? 2017 ?., 12:41:05 UTC+3 ??? Science Student ???:
Can someone explain this k symbology of vs as
k){x:y}Is : an adverb each left or something else ? reason its confusing is if its an adverb then where is the verb ?
Question becomes more interesting because x and y are variables then what is the adverb doing (possibly) without the verb ? See x and y as variables
x:", "
y:“spring, summer, autumn, winter”
k)x:y
Output same as vs
(“spring”;“summer”;“autumn”;“winter”)
An adverb can be applied to anything not just a verb. x/:y means (x/:) y where (x/:) is a new function created by /:
For example: xor via an adverb - (01b;10b)'[100010b;101011b]
???, 27 ??? 2017 ?., 9:54:39 UTC+3 ??? newstud...@gmail.com ???:
Question becomes more interesting because x and y are variables then what is the adverb doing (possibly) without the verb ? See x and y as variables
x:", "
y:“spring, summer, autumn, winter”
k)x:y
Output same as vs
(“spring”;“summer”;“autumn”;“winter”)
Thanks a lot for explaining this . If you do not mind, I would like to understand this better and had a few questions:
What does (x/:) in your example mean ? What if x was a list of lists or numeric ? Is there any documentation regarding an adverb not having a verb when applying it to something ?
You can think of an adverb as a function that takes another function and extends it. Thus /: could be defined as
{[f;x;y] f each y} / 2 args
{[f;x] $[x~a;…;x~b;…]} / 1 arg
(x/:) would mean {[f;x] …}
???, 27 ??? 2017 ?., 18:06:43 UTC+3 ??? Science Student ???:
Thanks a lot for explaining this . If you do not mind, I would like to understand this better and had a few questions:
What does (x/:) in your example mean ? What if x was a list of lists or numeric ? Is there any documentation regarding an adverb not having a verb when applying it to something ?
Once you move to k level, symbols are “overloaded” and behave differently based on input type.
/: is defined as a adverb in q (q for mortals). But there is no k for mortals. To learn k be a bit openminded to symbols being overloaded n keep looking at q function definitions.