enlist¶
Make a list
enlist x enlist[x] enlist[x;y;z;…]
Returns a list with its argument/s as items.
The most common use is to make a 1-item list.
An atom is not a one-item list: enlist and first convert between the two.
q)a:10
q)b:enlist a
q)c:enlist b
q)type each (a;b;c)
-7 7 0h
q)a~b
0b
q)a~first b
1b
q)b~c
0b
q)b~first c
1b
The result has as many items as the keyword is applied to.
Unlike user-defined functions, enlist is not limited to 8 arguments.
Where x is a dictionary, the result is a 1-item table.
Atoms to lists
To ensure all items in a list are themselves lists and not atoms, use (),, which leaves lists unchanged.
For example, {(),x} each foo converts any atoms in list foo into singleton lists.