Re: Iterate/Converge syntax Question




To: “[kdb+] [kdb+]”
In-Reply-To:
Message-Id:
X-Mailer: Apple Mail (2.3445.6.18)

that looks nice

Do also might be a better name for Repeat as it emphasises the =
imperative analogs (k3 used this terminology for this reason i would =
think)

also i find that enlist / list-creation can be very enlightening about =
adverbs across the board
as it’s visual compared to something more arithmetic
to be fair there are a couple of examples like this already on the wiki

Monadic scan/over
q)5 enlist\1
1
,1
,1
,1
,1
,1

q)5(f;)\1<br>1<br>(f;1)
(f;(f;1))
(f;(f;(f;1)))<br>(f;(f;(f;(f;1))))<br>(f;(f;(f;(f;(f;1)))))

Each-es
q)(f;)each 1 2 3<br>f 1
f 2<br>f 3
q)(f;;)prior 1 2 3<br>f 1 0N
f 2 1<br>f 3 2
q)1 2 3(;)/:“abc”
1 2 3 “a”
1 2 3 “b”
1 2 3 “c”
q)1 2 3(;):“abc”
1 “abc”
2 “abc”
3 “abc”
q)1 2 3(;)'“abc”
1 “a”
2 “b”
3 “c”
q)1 2 3(;)/::“abc”
1 “a” 1 “b” 1 “c”
2 “a” 2 “b” 2 “c”
3 “a” 3 “b” 3 “c”
q)1 2 3(;):/:“abc”
1 “a” 2 “a” 3 “a”
1 “b” 2 “b” 3 “b”
1 “c” 2 “c” 3 “c”

scan/over with a function taking more than 2 parameters
q)(f;;;)/[x;0 1 2 3;“abcd”]
f<br>(f;(f;(f;`x;0;“a”);1;“b”);2;“c”)
3
“d”

etc.

Cheers,
Attila





To: personal-kdbplus@googlegroups.com
In-Reply-To:
Message-Id:
X-Mailer: Apple Mail (2.3273)

this is a lovely thread. thanks guys.

Thanks for the excellent visual examples! 

Do appeals because we have While, so it would mirror the do and while keywords. I’ll give that some thought.




Stephen Taylor | Librarian | Kx | +44 7713 400852 | stephen@kx.com