nila_joy Posted November 16, 2011 Posted November 16, 2011 HI .. Its me again I have a list like (((block1 ((a b) (m n))) (block2 ((x y) (m n))) ....) Block name will be a user input .. if I input "block1" ans will be (((a b) (m n))) ... I got function "member" which can match and extract a value from a list.. any other suggestion? pbe, David, Tharwat, Lee , resu.. ..guys I hope u all are not in vacation .. ...Thnx.. Subho Quote
SOliver Posted November 16, 2011 Posted November 16, 2011 Probably what the native functions do but... in lisp (defun getAtom (label lst / i len return ) (setq i -1 len (length lst)) (while(< (setq i (1+ i)) len) (if(eq label (car (nth i lst))) (setq return (nth i lst) i len) ) ) return ) Quote
nila_joy Posted November 18, 2011 Author Posted November 18, 2011 list : - ((block1 (m n) ( k r)) (block2 (r t) (y c)) .........) [may be sub-list repeat multiple times] block name will be user input.. if i input block1, the result will be ((block1 (m n) ( k r)) (block1 (.........)) will assoc works? Quote
Lee Mac Posted November 18, 2011 Posted November 18, 2011 will assoc works? Study the function and you tell me. 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.