Quantcast
Viewing all articles
Browse latest Browse all 14319

Please help with list construction

Hi all,

 

I have been working with this and now I get ; error: bad DXF group:

 

(PROGN (IF (SETQ IDX (dict-get "REVISION" "TOTAL"))
	 (PROGN	(REPEAT	IDX
		  (SETQ	REVS   (LIST (STRCAT "REVISION" (ITOA IDX))
				     (CONS "WHO" (dict-get (STRCAT "REVISION" (ITOA IDX)) "WHO"))
				     (CONS "WHEN" (dict-get (STRCAT "REVISION" (ITOA IDX)) "WHEN"))
				     (CONS "WHAT" (dict-get (STRCAT "REVISION" (ITOA IDX)) "WHAT"))
			       )
			REVLST (CONS REVS REVLST)
			IDX    (1- IDX)
		  )
		)
	 )
       )
       (DICT-PUT "REVISIONS" "LIST" REVLST)
)

 I'm not actually attempting any DXF so far as I know. I just need to assemble the list to store in the dictionary for later.

 

This version gives me good results, but, it does not provide the extra distinction of who, when, & what.

 

(PROGN (IF (SETQ IDX (dict-get "REVISION" "TOTAL"))
	 (PROGN	(REPEAT	IDX
		  (SETQ	REVS   (LIST (STRCAT "REVISION" (ITOA IDX))
				     (dict-get (STRCAT "REVISION" (ITOA IDX)) "WHO")
				     (dict-get (STRCAT "REVISION" (ITOA IDX)) "WHEN")
				     (dict-get (STRCAT "REVISION" (ITOA IDX)) "WHAT")
			       )
			REVLST (CONS REVS REVLST)
			IDX    (1- IDX)
		  )
		)
	 )
       )
       (DICT-PUT "REVISIONS" "LIST" REVLST)
)

The expected output is a string formatted as: ("REVISION1" ("WHO" . "NAME") ("WHEN" . "DATE") ("WHAT" . "A SENTENCE ABOUT CHANGES."))

 

ps- I tried mapcar and lambda but finally gave up and tried this approach. This is as close as I've gotten to my goal.

 

Please help. Thank you in advance. 

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 14319

Trending Articles