<br><div><span class="gmail_quote">On 6/13/07, <b class="gmail_sendername">Jens Axel Søgaard</b> &lt;<a href="mailto:jensaxel@soegaard.net">jensaxel@soegaard.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>&gt; The problem here is not that it is a complex object, but that<br>&gt; structure definitions are generative - it would have worked<br>&gt; if you used vectors. Back to the structure problem. To quote the<br>&gt; documentation:
<br><br>&gt;&nbsp;&nbsp; &quot;Each time a define-struct expression is evaluated, a new structure<br>&gt;&nbsp;&nbsp;&nbsp; type is created with distinct constructor, predicate, accessor, and<br>&gt;&nbsp;&nbsp;&nbsp; mutator procedures.&quot;</blockquote><div>
<br>Thanks for the great explanation Jens - this makes great sense - but is there a way to prevent struct being evaluated twice, once for (require) and once for (require-for-syntax)?&nbsp; In the example you cited the double eval is clearly intended because each define-struct is enclosed lexcially and it makes sense that they are different structs (like enclosed lambda &amp; variables are different), but IMHO (require-for-syntax) and (require) evaluate the same code twice is _surprising_ (I thought it&#39;s more like &quot;importing&quot; names to the transformation environment) - love to hear your and others&#39; take on whether this is expected.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">One solution is to calculate the values at expansion time, and<br>then expand to (create-foo val1 ...).
</blockquote><div><br>This is how I currently have it (but my code have multiple nested struct creations, which makes it difficult to fully leverage expansion time) - until I thought - why not try to see if the object(s) can be generated in compile time and return to run time... close but not quite :) 
<br><br>Very appreciated! ;) Thanks,<br>yc<br><br></div></div>