Open vbmithr opened 1 week ago
I am still studying parser to see how each-prior is being parsed so have no explanation but it works as expected for explicit lambda. Also train pierces which is cool.
{2_x}'x
(,2
,5
,8
,11
,14
,17)
(y_)'x
type error
x:6 3#!18
^
> \
(y_)x
(,2
,5
,8
,11
,14
,17)
@vbmithr, thanks for bringing this up. @kafka64 , thanks for those examples.
The only form of x f' y
that gk currently supports is for the slide adverb, which is a generalization of each-prior (see README.md), the case of -1 f' y
being the equivalent of k3 each-prior.
-1 ,'"asdf"
("sa"
"ds"
"fd")
The k3 style each you're expecting is still available with square brackets.
x:6 3#!18
y:2
_'[y;x]
(,2
,5
,8
,11
,14
,17)
Also, note that each-right is preferred for this case.
y_/x
(,2
,5
,8
,11
,14
,17)
The really important feature of k3 style each is the conformance. Which is why gk supports it with the square brackets.
x:("as";"df")
y:"gh"
,'[x;y]
("asg"
"dfh")
I have several discussions going on related to slide and each. I'm leaning toward making slide a named builtin and bringing back k3 style each. But I'm also waiting to see how this works in k9.