Odd behavior of show

Greetings,

I was reading the reference on _ <http://code.kx.com/wiki/Reference/Underscore#cut\>, and in the final example I don’t understand the output of show, specifically the trailing line that is “(::;::;::)”.  In my session I see slightly different but still odd output:

KDB+ 3.1 2014.07.01 Copyright (C) 1993-2014 Kx Systems
l32/ 4()core 15748MB j m5 127.0.1.1 NONEXPIRE 
q)\l sp.q
q)2 5 7_sp
+spqty!(s$s1s1s4;p$p3p4p5;400 200 100) +spqty!(s$s1s2;p$p6p1;100 300)
+spqty!(s$s2s3s4s4s1;p$p2p2p2p4`p5;400 200 200 300 400)
q)count each 2 5 7_sp
3 2 5
q)show each 2 5 7_sp
s  p  qty

s1 p3 400
s1 p4 200
s4 p5 100
s  p  qty

s1 p6 100
s2 p1 300
s  p  qty

s2 p2 400
s3 p2 200
s4 p2 200
s4 p4 300
s1 p5 400
::
::
::

The first two commands show that the third element result of cut has a count of 5, as expected.  But then show shows those extra “::” lines - what are these?

The same obtains with simple numeric lists:

q)2 5 7_til 12
2 3 4
5 6
7 8 9 10 11
q)count each 2 5 7_til 12
3 2 5
q)show each 2 5 7_til 12
2 3 4
5 6
7 8 9 10 11
::
::
::

What’s going on?

:: is the default return value

q)type {}

101h

here collected in a list returned from each
e.g.

q){}each til 3

::

::

::

show returns ::

q)show

k){1 .Q.s x;}

Ah ha!  Yes, that makes sense.

Thanks.

You can just put ; at the end of the line to suppress the output if you like:

q)show each 2 5 7_til 12;

2 3 4

5 6

7 8 9 10 11