Subject: Re: Q 4 LISP GURUs: EED retreival Date: Sat, 01 Feb 1997 00:00:00 GMT From: (Reini Urban) Organization: TU Graz, Architecture & X-Ray Newsgroups: comp.cad.autocad Morten Warankov wrote: >________________________________________________ >(defun cl ( a / a1) > (setq a1 "") > (foreach i a (setq a1 (strcat a1 (chb i)))) > (setq a (eval (read a1)))) > >;; a little helping function >;; add more cond's if you need >(defun chb (l / ) > (cond ((= l "{") (setq l "(list ")) > ((= l "}") (setq l ") ")) > ((= (type l) 'INT) (setq l (strcat (itoa l) " "))) > ((= (type l) 'REAL) (setq l (strcat (rtos l) " "))) > ((= (type l) 'STR) (setq l (strcat l " "))) > (T (alert (strcat "Unknown type of data: " l))) > ) > l >) Now this is REALLY elegant! -- -- Reini http://xarch.tu-graz.ac.at/autocad/ (defun remove (x y) ; by serge volkov (apply 'append (subst nil (list x) (mapcar 'list y))))