<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Aug 7, 2014, at 8:55 AM, Alexander D. Knauth <<a href="mailto:alexander@knauth.org">alexander@knauth.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><blockquote type="cite" style="font-family: Georgia; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div>Do you want something like this then:</div><div><font face="Courier New">(syntax-parse stx</font></div><div><font face="Courier New"> [(_ (~or ((((e ...) ...) ...) ...)</font></div><div><span style="font-family: 'Courier New';"> </span><font face="Courier New">(((d ...) ...) ...)</font></div><div><font face="Courier New"> ((c ...) ...)</font></div><div><font face="Courier New"> (b ...)</font></div><div><font face="Courier New"> a)</font></div><div><font face="Courier New"> . . .)</font></div><div><font face="Courier New"> #’(list (list a ... (list b ... (list c ... (list d ... (list e ...) ...) ...) ...) ...) ...)])</font></div></div></blockquote><div style="font-family: Georgia; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="font-family: Georgia; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Sorry I meant this:</div><div style="font-family: Georgia; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div>(syntax-parse #'(x (1 2 3 4) (5 (6 7) 8))</div><div> [(_ (~or ((~or ((~or ((~or (e ...) d) ...) c) ...) b) ...) a) ...)</div><div> #'(list (list a ... (list b ... (list c ... (list d ... (list e ...) ...) ...) ...) ...))])</div></div><br style="font-family: Georgia; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" style="font-family: Georgia; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Except going infinitely? For that I think you would need a recursive helper function. </div><div><br></div><div>Or do you want to just replace all instances of (a ...) with (list a ...) ?:</div><div><font face="Courier New">(define-syntax-class thing</font></div><div><font face="Courier New"> #:attributes (norm)</font></div><div><font face="Courier New"> [pattern (a:thing ...)</font></div><div><font face="Courier New"> #:with norm (list a.norm ...)]</font></div><div><font face="Courier New"> [pattern a</font></div><div><font face="Courier New"> #:with norm a])</font></div><div><br></div><div>Or what?</div></div></blockquote></blockquote><br></div><div>Sorry, I should probably clarify the problem I’m attempting to solve. I’ve got an application that creates a composite image using classes of objects that draw themselves. Essentially the macro Compose-A </div><div><br></div><div> (compose-A (<img | (img …)> …) …)</div><div><br></div><div>would produce something like:</div><div><br></div><div> {compose-A (compose-B <img | (compose-C img …)> …) …)</div><div><br></div><div>Compose-A can have an arbitrary number of compose-B clauses. </div><div>compose-B clauses can have an arbitrarily number of elements in any order consisting of ing or clause-C. </div><div>The clause-C consist of an arbitrary number of img. </div><div><br></div><div>I’ve been wondering about having to go with a recursive macro. Is there any code in the current system that can be modeled from?</div><div><br></div><div>-Kevin</div><br></body></html>