cancel
Showing results for 
Search instead for 
Did you mean: 

DLL functions -- 2: only supports functions with rank >= 1?

Flying
New Contributor III
Hi,

I'd like to confirm if 2: supports only functions with rank >= 1. If so, what's the rationale to disallow 0-argument functions from being called through to DLLs?

Thanks,
Freddie
4 REPLIES 4

mark_rooney
New Contributor
Hi Freddie,

I believe this restriction is due to the fact that all functions in kdb are technically 1+ argument
functions (even if they appear to take none). Calling a function f with no arguments (e.g f[]) just passes
in a dummy argument to the function that is not used. So if you want to have a zero argument function in
your C code, you just define it with one argument and don't use the argument.

Thanks
--
Mark Rooney
Financial Software Developer
AQUAQ Analytics

Flying
New Contributor III
Thanks for the confirmation. Yes, that's my observation so far and my "work-around" as well.

charlie
New Contributor II
New Contributor II
confirmed. kdb+ functions, whether in q/k or c, always take at least one argument. If unspecificied, it is identity (::)

Flying
New Contributor III
Thanks for the confirmation. Yes, that's my observation so far and my "work-around" as well.