Translating parse result into instances
- From: Frank Goenninger DG1SBG <dont-email-me@xxxxxxxxxx>
- Date: Thu, 30 Aug 2007 21:53:53 +0200
I have a - hm, what? - a "stream" of data as follows:
("model" (("id" "FRGO"))
("polygon" (("color" "+RED+") ("class" "GNC-QUAD"))
("points" (("n" "4"))
("point" NIL ("x" NIL "0") ("y" NIL "0") ("z" NIL "0"))
("point" NIL ("x" NIL "100") ("y" NIL "0") ("z" NIL "0"))
("point" NIL ("x" NIL "100") ("y" NIL "-100") ("z" NIL "0"))
("point" NIL ("x" NIL "0") ("y" NIL "-100") ("z" NIL "0"))))
("polygon" (("color" "+BLUE+") ("class" "GNC-QUAD"))
("points" (("n" "4"))
("point" NIL ("x" NIL "50") ("y" NIL "0") ("z" NIL "5"))
("point" NIL ("x" NIL "100") ("y" NIL "60") ("z" NIL "5"))
("point" NIL ("x" NIL "100") ("y" NIL "-60") ("z" NIL "50"))
("point" NIL ("x" NIL "50") ("y" NIL "-100") ("z" NIL "50"))))
("polygon" (("color" "+GREEN+") ("class" "GNC-QUAD"))
("points" (("n" "4"))
("point" NIL ("x" NIL "-50") ("y" NIL "10") ("z" NIL "30"))
("point" NIL ("x" NIL "150") ("y" NIL "60") ("z" NIL "5"))
("point" NIL ("x" NIL "150") ("y" NIL "-60") ("z" NIL "50"))
("point" NIL ("x" NIL "-50") ("y" NIL "-100") ("z" NIL "50")))))
I need to create a Model instance with ID slot being bound to
:frgo. Next I want to create Polygon instances ... You get the idea.
New one for me, really. What if this goes to some few hundreds of
polygons... So I am looking not for complete code just for a few
pointers/hints which route to go. Loop? Mapcar combined with a large
cond or so?
Thx!!
Cheers
Frank
--
Frank Goenninger
frgo(at)mac(dot)com
"Don't ask me! I haven't been reading comp.lang.lisp long enough to
really know ..."
.
- Follow-Ups:
- Re: Translating parse result into instances
- From: Pillsy
- Re: Translating parse result into instances
- From: Ken Tilton
- Re: Translating parse result into instances
- From: Ari Johnson
- Re: Translating parse result into instances
- Prev by Date: Re: gc bug is SBCL?
- Next by Date: Re: gc bug is SBCL?
- Previous by thread: debug .fas?
- Next by thread: Re: Translating parse result into instances
- Index(es):