Subject: Re: Q 4 LISP GURUs: EED retreival Date: Tue, 28 Jan 1997 00:00:00 GMT From: Morten Warankov Organization: ABACUS To: Vladimir Nesterovsky Newsgroups: comp.cad.autocad My suggestion for how to solve it: In plain recursion (I need to sleep on it to include mapcar and lambda :) ) (defun chbr (a / ) (if (= (car a) "{") (setq a (append '("(") (cdr a))) ) ;;I suppose this could be done without an 'if' statement. ;;depending on how sure you are about the first element. (while (member "{" a) (setq a (append (sub a (member "{" a)) '("(") (cdr (member "{" a)) ) ) ) (while (member "}" a) (setq a (append (sub a (member "}" a)) '(")") (cdr (member "}" a)) ) ) ) The only thing you miss is the 'sub' function as posted by Reini: (defun sub (in out) (cond ((null in) nil) ((member (car in) out) (sub (cdr in) out)) (T (cons (car in) (sub (cdr in) out))))) Solved in lisp, with plain recursion. Pleased to have helped, Mortenw