True story and good observation Tim. It's also why when you pass a selection set to a function you have to be careful (because it's treated as a reference).
Brief illumination:
( (lambda ( / foo ss )
(defun foo ( ss )
(if (and
(eq 'pickset (type ss))
(< 0 (sslength ss))
)
(ssdel (ssname ss 0) ss)
)
)
(if (setq ss (ssget "x"))
(progn
(princ
(strcat
"Selection set ss's length before (foo ss): "
(itoa (sslength ss))
"\n"
)
)
(foo ss)
(princ
(strcat
"Selection set ss's length after (foo ss): "
(itoa (sslength ss))
"\n"
)
)
)
(princ "Errrm, try this in a dwg with some entities.")
)
(princ)
)
)
Not suggesting you don't know this Tim; it's for the benefit of those that might not.