Happy Hobbit Posted April 30, 2016 Author Posted April 30, 2016 This turned into quite a lengthy debate about something I didn't actually need! Interesting though. pBe solved the original question in #2 for me by making me read the Autodesk Help properly this time, instead of skimming it. Thanks all for answering though. I somehow knew Lee & Tharwat would have a solution to the rhetorical question posed by pBe, which certainly made me think hard, but not solved by me. At least I guessed right that it would involve numberp, I suppose it could be coded using stringp instead, perhaps one for another day. - Harry H Quote
pBe Posted May 1, 2016 Posted May 1, 2016 Try these lists:..... Our limits were up to 9 With no duplicate keys and always a mix of letters & numbers. Sooo busted Hence the NTS Quote
pBe Posted May 1, 2016 Posted May 1, 2016 This turned into quite a lengthy debate about something I didn't actually need! Interesting though. - Harry H But you had to admit that it was fun... I hadn't had much practice with programming lately. [ Excuses.. excuses... ] Quote
Happy Hobbit Posted May 1, 2016 Author Posted May 1, 2016 I agree, writing lisp is fun, better than logic puzzles, lisp (usually) has a useful end result, although I do admit to casual lisping where I'm just experimenting/playing about Quote
svorgodne Posted May 22, 2018 Posted May 22, 2018 Could you be so kind to explain me what is A and B? Or in other words... How is the program working? I simply do not understand the logic. Thanks in advance S *PING* Easy when you know how, isn't it? The variable holding my list is z All I needed was: (vl-sort z (function (lambda (a b) (< (car a) (car b))))) Must be half asleep still :-p Thank you for that pBe Quote
dlanorh Posted May 22, 2018 Posted May 22, 2018 Could you be so kind to explain me what is A and B? Or in other words... How is the program working? I simply do not understand the logic. Thanks in advance S It is an anonymous lambda function a and b represent the items in a list so that (car a) is the first item of the sub list and (car b) the first item of the next sub list. you can call them what you like a & b, x & y etc Quote
BIGAL Posted May 23, 2018 Posted May 23, 2018 To confuse you a bit more this is a double sort working on say X & Y values. I use it to find columns of common items based on X value. eg ((X1 Y1 text)(x3 Y3 text).... = ((X1 Y1 text)((X1 Y2 text)((X2 Y3 text).... ; sorts on 1st two items (setq lst (vl-sort lst '(lambda (x y) (cond ((= (cadr x)(cadr y)) (< (car x)(car y))) ((< (cadr x)(cadr y))) )))) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.