/ e. g., it does not seem to work for chars:q)a:"abcdefghijklmnopqrstuvwxyz"q)a"abcdefghijklmnopqrstuvwxyz"q)a$"helloworld"k){$[|/(#v)in r:(v:!. x)?y;'
cast;x!r]}'char?char"helloworld"q))\q)/ e. g., it does not seem to work for strings either:q)c:("abcd";"hello";enlist "a";"dict")q)c"abcd""hello","a""dict"q)
c$"abcd"k){$[|/(#v)in r:(v:!. x)?y;'cast;x!r]}'type!:("abcd";"hello";,"a";"dict")q))\/ e. g., it does work for symbols:q)l:
$/:"a quick brown fox jumps over the lazy dog"q)la``q
ui
ck``b
ro
wn``f
ox``j
um
ps``o
ve
rt`h`e
la
zy``d
ogq)h:distinct lq)h
aq`u`i`c`k`b`r`o`w`n`f`x`j`m`p`s`v`e`t`h`l`z`y`d`gq)`h$`w`h$`wq)`h$`$/:"hello world"`h$`h`e`l`l`o
wo
rl
d
enumeration only works with symbols.On Dec 1, 9:40?pm, GH <yzg…> wrote:> / e. g., it does not seem to work for chars:> q)a:“abcdefghijklmnopqrstuvwxyz”> q)a> “abcdefghijklmnopqrstuvwxyz”> q)a$"helloworld"> k){$[|/(#v)in r:(v:!. x)?y;'
cast;x!r]}> 'char> ?> char> "helloworld"> q))\> q)>> / e. g., it does not seem to work for strings either:> q)c:("abcd";"hello";enlist "a";"dict")> q)c> "abcd"> "hello"> ,"a"> "dict"> q)
c$“abcd”> k){$[|/(#v)in r:(v:!. x)?y;'cast;x!r]}> 'type> !:> ("abcd";"hello";,"a";"dict")> q))\>> / e. g., it does work for symbols:> q)l:
$/:“a quick brown fox jumps over the lazy dog”> q)l> a``q
ui
ck``b
ro
wn``f
ox``j
um
ps``o
ve
rt`h`e
la
zy``d
og> q)h:distinct l> q)h>
aq`u`i`c`k`b`r`o`w`n`f`x`j`m`p`s`v`e`t`h`l`z`y`d`g> q)`h$`w> `h$`w> q)`h$`$/:"hello world"> `h$`h`e`l`l`o
wo
rl
d</yzg…>
Thanks for the clarification.On Dec 2, 3:57?pm, aka_magnus <niall…> wrote:> enumeration only works with symbols.>> On Dec 1, 9:40?pm, GH <yzg…> wrote:>> > / e. g., it does not seem to work for chars:> > q)a:“abcdefghijklmnopqrstuvwxyz”> > q)a> > “abcdefghijklmnopqrstuvwxyz”> > q)a$"helloworld"> > k){$[|/(#v)in r:(v:!. x)?y;'
cast;x!r]}> > 'char> > ?> > char> > "helloworld"> > q))\> > q)>> > / e. g., it does not seem to work for strings either:> > q)c:("abcd";"hello";enlist "a";"dict")> > q)c> > "abcd"> > "hello"> > ,"a"> > "dict"> > q)
c$“abcd”> > k){$[|/(#v)in r:(v:!. x)?y;'cast;x!r]}> > 'type> > !:> > ("abcd";"hello";,"a";"dict")> > q))\>> > / e. g., it does work for symbols:> > q)l:
$/:“a quick brown fox jumps over the lazy dog”> > q)l> > a``q
ui
ck``b
ro
wn``f
ox``j
um
ps``o
ve
rt`h`e
la
zy``d
og> > q)h:distinct l> > q)h> >
aq`u`i`c`k`b`r`o`w`n`f`x`j`m`p`s`v`e`t`h`l`z`y`d`g> > q)`h$`w> > `h$`w> > q)`h$`$/:"hello world"> > `h$`h`e`l`l`o
wo
rl
d</yzg…></niall…>
you can also enumerate on a keyed table for foreign keying
q)t:([a:“f”$1,2,3];b:1,2,3)
q)t1:(a:10?“f”$1,2,3;c:10?1) q)update
t$a from t1
t1
q)show meta t1
c | t f a |
---|---|
a | f t |
c | s |
q)select a,a.b,c from t1 where c=`j | |
a b c |
1 1 j
1 1 j
but for vectors/atoms, only symbol types.