Home › Forums › kdb+ › Why do we put a 0# here: @[`.;t;@[;`sym;`g#]0#] › Re: Why do we put a 0# here: @[`.;t;@[;`sym;`g#]0#]
-
TLDR: the expression initialises a list
t
of tables in the default namespace, setting the grouped attribute on the symbol column and removing all the table rows.How that? The function called is not Apply but Amend At
@
in its ternary form.The first argument is the default namespace
`.
, which, as a namespace, is also a dictionary.The second argument
t
will be a symbol vector of names of tables in the default namespace; i.e. globals.The third argument is the function to be applied to each table. Youve already spotted that the unary projection
@[;`sym;`g#]
sets the grouped attribute on thesym
column. It is composed (by juxtaposition) with the unary projection0#
. Applied to a table,0#
removes all the rows.So the function applied to each table named in
t
is the composition@[;`sym;`g#] 0#
. That is, remove the rows and set grouped on thesym
column.