Can someone please give an example of the highlight especially the second one.
https://code.kx.com/wiki/Reference/BangSymbol
other
With a negative integer on the left-hand side, calls an internal function; for gory details, see [internal functions](“https://code.kx.com/wiki/Reference/BangSymbolInternalFunction” ““Reference/BangSymbolInternalFunction””).
With a symbol list on the left-hand side and an hsym symbol atom on the right-hand side, creates the flip of a splayed table. With a symbol list on the left-hand side and a non-hsym symbol atom on the right-hand side, creates the flip of a partitioned table. In either case, once the resulting object is flipped, the symbol list from the left-hand side becomes the columns of the table.
these are internal representations of partitioned/splayed tables - it’s unlikely that you’d need to construct either by hand, however you might observe them when debugging.
e.g.
q)`:db/2000.01.01/t/ set(0 1)
`:db/2000.01.01/t/
q)\l db
q)0N!t; / partitioned table
+(,x)!
t
q)0N!get`:2000.01.01/t/; / splayed table
+(,x)!
:2000.01.01/t/
to translate that to q
flip(enlistx)!
t
flip(enlistx)!
:2000.01.01/t/
Thanks.
Doc says right hand side of splayed table is hsym while partioned table is non-hsym but in your example it is flipped. Any thoughts there ?
With a symbol list on the left-hand side and an hsym symbol atom on the right-hand side, creates the flip of a splayed table. With a symbol list on the left-hand side and a non-hsym symbol atom on the right-hand side, creates the flip of a partitioned table. In either case, once the resulting object is flipped, the symbol list from the left-hand side becomes the columns of the table.
On Wednesday, March 7, 2018 at 12:07:21 PM UTC+8, Science Student wrote:
Thanks.
Doc says right hand side of splayed table is hsym while partioned table is non-hsym but in your example it is flipped. Any thoughts there ?
I meant that in Charles example splayed table is not showing a hsym but just a sym when the doc says it shows an hsym. This is a contradiction. Similar in the partitioned table case.
flip(enlistx)!
t / non-hsym symbol, a partitioned table
flip(enlistx)!
:2000.01.01/t/ / hsym symbol, a splayed table
On Wednesday, March 7, 2018 at 1:08:07 PM UTC+8, Science Student wrote:
I meant that in Charles example splayed table is not showing a hsym but just a sym when the doc says it shows an hsym. This is a contradiction. Similar in the partitioned table case.
?this is a definition of hsym: http://code.kx.com/q/ref/filewords/#hsym
but the word hsym also describes symbols that are unchanged by the application of this function
hsyms include symbols starting with a colon - eg
q)hsym `:2000.01.01/t/
`:2000.01.01/t/
-
So if you do hsym hsym hsym :something** you will get **
:something unchanged. But what is your point ?
-
Does `:sym?list in an hdb do all of the following:
A. Update file called sym in hdb root ?
A1. How does it know where hdb root is in the program ? It could be in a place different than the starting point of the program, right ?
B. reload sym file in a variable called sym ?
C. All .Q funcs would have to re-written if we use a filename other than sym right ?
2.A. `:sym?list always updates ./sym file, i.e., the sym file in the current working directory.
2.A1. Once you load an hDB (\l dbdir), your current working directory is switched to the root of the hDB, which could be different from your starting directory.
2.B. It does. Please refer to the documentations provided by the previous links.
2.C. Yes for some, no for some others. And you don’t always have to use the .Q functions.