I have
(setq lst (vl-sort lst (function (lambda (a b) (< (car a) (car b))))))
which sorts a list for me, the list is of a form
(("101" "3E16F") ("102" "3E0C3") ("103" "3DFFB") ("104" "3DFD9") ("105" "3DFA8") ("106" "3DFCA")....)
text content, entity handle. I guess I should call this an association list because the text is the (1 . "text") from one entity, and the other is the (5. "handle") from a lwpolyline, which might imply that I am learning something.
I look into the help files, and searched the board(s). I look for references to lambda, and cross referenced function, ' and list, mapcar and apply. Lambda is defining an anonymous function (< (car a) (car b)), and passing the result through function, which is the same as ', but allows for optimization, which passes that result to vl-sort to use on the list lst.
I typed it myself, and it still is at least 50% gibberish to me.
Would someone explain in their own words what is happening here, please? I am wanting, at this point in the program, to change the nature of the list sorted to include a points list for the polyline, because this would be the easiest time to get it, rather than grabbing the handle and (entget (handent)).
I am guessing there is a way. Maybe
(("101" "3E16F" ((x y)(x y) (x y)....)("102" "3E0C3")((x1 y1)(x2 y2]) (x3 y3)....)... )
or
(("101" ("3E16F" (x y)(x y) (x y)....)("102" "3E0C3")((x1 y1)(x2 y2) (x3 y3)....)... )
or even
(("101" '("3E16F" (x y)(x y) (x y)....)("102" "3E0C3")((x1 y1)(x2 y2) (x3 y3)....)... )
Understanding is what I am after.
thanks,
roy