Variable existence

Hi all.
I am curious how can I check existence of system variables (eg which placed in z,q,Q namespaces)?

that would be with \v
  http://code.kx.com/wiki/Reference/Sysv

but I notice that some symbols might not be shown:

q)\v .q

,`csv

and \f

q)\f .q

ajaj0allandanyascasofattravgsceilingcolscorcountcovcrosscutdeltasdescdevdifferdistincteachejenlistevalexceptfbyfillsfirstfkeysflipfloorgetgroupgtimehclosehcounthdelhopenhsymiascidescijinterinvkeykeysljljfloadlowerlsqltimeltrimmavgmaxsmcountmd5mdevmedmetaminsmmaxmminmmumodmsumnegnextnotnulloroverparsepeachpjprdsprevpriorrandrankratiosrazeread0read1reciprocalreverserloadrotatersavertrimsavescansetshowsignumssrstringsublistsumssvsystemtablestiltrimtypeujungroupunionupperupsertvaluevarviewviewsvswherewjwj1wwxascxbarxcolxcolsxdescxgroupxkeyxlogxprevxrank

Please use following…

q)key `.Q

``khostaddrgcwresaddmonthsCfffmtfffloptdefqtvqpVftordtx`t..

q)key `.q

``negnotnullstringreciprocalfloorceilingsignummodxbarxlogandor`ea..

or you can get as…

q)select from `.Q

         | ::

k        | 3.1

host     | ![-12]

addr     | ![-13]

gc       | ![-20]

w        | k){usedheappeakwmaxmmapmphysymssymw!(.“\w”),.“\w 0”}

res      | inwithinlikebinbinrssifdowhileexecselectinsertupdate..

addmonths| k){(“d”$m+y)+x-“d”$m:“m”$x}

Cf       | k){x 1:0xff200000000000005700000000000000;(`$($x),“#”)1:0x}

f        | k){$[^y;“”;y<0;“-”,f[x;-y];y<1;1_f[x;10+y];1e13>j:“j”$y*/x#10;(x_j..

fmt      | k){$[x<#y:f[y;z];x#“*”;(-x)$y]}

ff       | k){$[&/(!+y)in f:!+x;x;x,'(f_y)(#x)#0N]}

fl       | k){$[98h=t:@x;+fl[+x;+y];99h=t;@[x,y;f;:;x[f]fl’y f@:&(f:!x)in!y];..

opt      | k){[o]x::$[#i:&o like"-[^0-9]*";i[0]#o;o];((`$1_*:)'o)!1_'o:i_o}

q)select from `.q

          | ::

neg       | -:

not       | ~:

null      | ^:

string    | $:

reciprocal| %:

floor     | _:

ceiling   | -_-:

signum    | k){(x>0)-x<0}

mod       | k){x-y*x div y}

xbar      | k){x*y div x:$[16h=abs[@x];“j”$x;x]}

xlog      | k){log[y]%log x}

and       | &

or        | |

each      | k){x’y}

scan      | k){x\y}

Thanks

Hemant

not work with .z:
.z.zd: (16;2;1)

key `.z

hmmm - this example does work in the .z dir:

q)\d .z

q.z)zd: (16;2;1)

q.z)\v

,`zd

and then in root:

q.z)\d .

q)eval `.z

  | ::

zd| 16 2 1

.z is a faked namespace, and is not backed by a dict. This should return the contents

q)f:{raze{@[enlist[`$x]!enlist value@;`$“.z.”,x;{enlist[`]!enlist(::)}]}each string (),x}

q)faacbbmcexitfhikKlnNopPpcpgpdphpipmpopppspwqstsuvswWwsxzZtTdT`zd

Thanks Charles, function is useful!

typo at end of sym list?  

 …tTdT`zd  might be  

 …tTdD`zd

yes, thanks

q)g:{x!@[eval;;::]each `$“.z.”,/:string x}

q)gabcexitfhikKlnNopPpcpgpdphpipmpopppspwqsts

a   | 2130706689i

b   | (`symbol$())!()

c   | 2i

exit| “.z.exit”

f   | `

h   | `sff

i   | 16541i

k   | 2013.04.05

K   | 3f

l   | (,“2”;“2015.08.01”;“2015.08.01”..

n   | 0D13:25:32.043174000

..

q)h:{u:first 1?0Ng;(,x[w])!(::),d w:where not u~'d:@[eval;;u]each $“.z.”,/:string x}

which might be equivalent to f.  i feel a simplification is possible.

Attila would write

s[w]!v w:where not(::)~/:v:{@[value;“.z.”,string x;{}]}each s

which is pretty close to yours. My mind is on other problems…

or even
q)s:aacbbmcexitfhikKlnNopPpcpgpdphpipmpopppspwqstsuvswWwsxzZtTdT`zd

q)#[;v]where not(::)~/:v:s!{@[value;“.z.”,string x;{}]}each s

a little shorter
q)(where not(::)~/:v)#v:s!@[value;;{}]each “.z.”,/:string s

q)where[(::)~'v]_v:s!@[value;;{}]each “.z.”,/:string s

neat, can also do

q)where[(::)~'v]_v:s!{@[value; sv.z,x;{}]}each s

q)value .z.zd

'.z.zd

q)hasZd:not null@[value;.z.zd;{}]

q)hasZd

0b

q).z.zd:0 2 17

q)hasZd:not null@[value;.z.zd;{}]

q)hasZd

1b

be careful what null type you choose for returning.

q)@[{value x;1b};`.z.f;{0b}]

1b