Function restrictions

If I run this in a script it works.

 dwaction: ([action:`dload`kload`kinc]desc:(“D”;“K”;“KI”));

 `:db/dwaction set dwaction;

 dwstatus: ([status:`progress`success`error]desc:(“P”;“F”;“E”));

 `:db/dwstatus set dwstatus;

 dwlog: (action:dwaction$();status:dwstatus$();start:datetime$();end:datetime$();err:();note:());

 `:db/dwlog set dwlog;

the error arises from missing globals. The foreign key symbol (closely related to enums) needs to be a global. You can reproduce the error condensed into

q)f:{a:abc;a$ab`c}

q)f

{a:abc;a$ab`c}

'type

$

`a

ab`c

q)f:{a set abc;a$abc}

q)f

a$abc