You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ref/join.md
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,37 @@ q)v,(type v)$0xab
47
47
1.00 2.34 -567.1 20.00 171e
48
48
```
49
49
50
+
The result is a general list if the two arugments are [enumeration](enumerate.md) atoms of different domains, or one is an enumeration and the other is a regular symbol:
51
+
52
+
```q
53
+
q)sym:`a`b
54
+
q)sym2:`c`d
55
+
q)(`sym$`b),`sym2$`b
56
+
`sym$`b
57
+
`sym2$`b
58
+
q)(`sym$`b),`b
59
+
`sym$`b
60
+
`b
61
+
q)`b,(`sym$`b)
62
+
`b
63
+
`sym$`b
64
+
```
65
+
66
+
On the other hand, if either or both arguments are lists and not of the same enumeration domain, any enumerations are de-enumerated:
67
+
68
+
```q
69
+
q)(`sym$`a`b),`sym2$`b`c
70
+
`a`b`b`c
71
+
q)(`sym$`a),`c`d
72
+
`a`c`d
73
+
q)(`sym$`a`b),`c
74
+
`a`b`c
75
+
q)`a,`sym2$`b`c
76
+
`a`b`c
77
+
q)`a`b,`sym2$`c
78
+
`a`b`c
79
+
```
80
+
50
81
`,`(join) is a [multithreaded primitive](../kb/mt-primitives.md).
51
82
52
83
@@ -160,6 +191,30 @@ q)s
160
191
4 5 6
161
192
```
162
193
194
+
If `x` contains an enumeration, append will enumerate `y` against `x`'s domain, which may fail if the appended symbols are not in that domain:
195
+
196
+
```q
197
+
q)sym:`a`b
198
+
q)e:`sym$`a`b
199
+
q)e,:`b
200
+
q)e
201
+
`sym$`a`b`b
202
+
q)e,:`c
203
+
'cast
204
+
[0] e,:`c
205
+
^
206
+
207
+
```
208
+
209
+
Conversely, if `x` contains unenumerated symbols, any enumerations are de-enumerated as part of the append:
0 commit comments