KDB+ 4.0 2020.08.28 Copyright (C) 1993-2020 Kx Systems
m64/ 4(16)core 4096MB EXPIRE 2021.03.22
q)","sv (“ab”;“cd”)
“ab,cd”
q)","sv (“ab”;“c”)
'type
[0] ","sv (“ab”;“c”)
^
q))
\ why does scalar => vector not work with 1 character strings
KDB+ 4.0 2020.08.28 Copyright (C) 1993-2020 Kx Systems
m64/ 4(16)core 4096MB EXPIRE 2021.03.22
q)","sv (“ab”;“cd”)
“ab,cd”
q)","sv (“ab”;“c”)
'type
[0] ","sv (“ab”;“c”)
^
q))
\ why does scalar => vector not work with 1 character strings
A “string” in kdb+ is actually just a synonym for a vector of chars, there is no string datatype. sv takes a list of strings (i.e. not chars).
If you enlist the “c” it will work, as it will become a vector containing one char only.
“,” sv (“ab”; enlist “c”) yields “ab,c” as expected.