« first day (1075 days earlier)      last day (460 days later) » 

13:00
how do i raise x to power of y?
y(x*)/1
Or */y#x (shorter but doesn't work for array inputs)
'rank
 3 {y+x} 4
   ^
@copy thanks
13:27
@copy can you explain how that works?
13:37
n m/y is for (github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual.md#over), so y times multiply 1 with x
it only works with oK?
what about ngn/k?
13:55
Also works in ngn/k
ngn
ngn
14:35
@PyGamer0 k is not apl! that parses as 3[{y+x}[4]] (3 applied to the result from {y+x} applied to 4). in k {} is a noun. see the grammar near the end of \h in the repl.
@ngn oh
> grammar: E:E;e|e e:nve|te| t:n|v v:tA|V n:t[E]|(E)|{E}|N
^ is that what your talking about?
ngn
ngn
@PyGamer0 yes
so how to make that work?
3{x+y}5
ngn
ngn
@PyGamer0 aplers often complain about the lack of user-defined functions that can be used infix in k, but i think that (and the fact that identifiers are always nouns too) was one of the most important improvements, as it gives the k parser the ability to parse an expression without knowing what values all variables have
@PyGamer0 {x+y}[3;5]
this is called an m-expression. it was supposed to be the notation in lisp but early on f[x;y] was replaced with s-expressions: (f x y)
@ngn ah now it makes sense as to why i can define the arguments like {[x;y] x+y}
ngn
ngn
14:43
k functions can be applied to up to 8 arguments
oh there is a limit? why?
ngn
ngn
it makes it easier/simpler/more efficient to implement some things. and in reality no one ever uses 8 args or axes, so.. :)
btw, func[x] or func[x;y], func[x;y;z] is not only the notation for function application, but also for array indexing and dictionary lookup: array[i;j], dict[key]
when there's only one argument/index/key, you can also write func x, array i, dict k
or func@i, array@i, dict@k (where @ is the "apply" verb)

« first day (1075 days earlier)      last day (460 days later) »