Subject: Q 4 LISP GURUs: EED retreival Date: Tue, 28 Jan 1997 00:00:00 GMT From: vnestr@netvision.net.il (Vladimir Nesterovsky) Organization: IDAN Computers Newsgroups: comp.cad.autocad Hello to all LISP gurus! Consider xdata put/retreival system capable of storing list of ANY structure in EED (R12 compatible, so no fancy xrecords here!). Storage is simple with automatic type detection i.e. (defun make-xlist(val) (cond ((null val) '(1000 . "*NIL*")) ((atom val) (case (type val) '( ;;in AutoLISP ('INT (cons 1070 val)) ('REAL (cons 1040 val)) ('STR (cons 1000 val)) ))) ((atom (cdr val)) val) ;;keep it as it is (MUST be valid DXF group) (T (append '((1002 . "{")) (mapcar 'make-xlist val) '((1002 . "}") )))) and then obvious manipulations. When receiving data from EED, after some MAPCAR 'CDR etc, I eventually get i.e. for '("some" ("data" 1 2 (3.0))) list -->> '("{" "some" "{" "data" 1 2 "{" 3.0 "}" "}" "}") (OR you may see an example for it in ACAD EED on VIEWPORT entity with a list of CV frozen layers). NOW THE _BIG_ QUESTION: how can I translate the curly braces BACK into parens ??? I gave up on doing this in LISP, and did it in ADS with plain resbuf substitution, but it would be nice to see how it can be done in LISP, with all the recursions, MAPCARs and LAMBDAs. :) Any takers?? The winner gets the glory and admiration of us all. :) (this is also a FAQ candidate). -- Vladimir Nesterovsky ADS/LISP/C/C++ etc IDAN Computers Ltd.