macro almost there :-)<br><br>given (define-type point x y z)<br><br>if at run time, I have the symbol "point", is there anyway that I can make that will return me the name of the fields, i.e. '(x y z)? I'd rather have this than all functions that start with point-* since I also define some of them myself, like point-+ point-scale, ...<br>
<br>Thanks!<br><br><div class="gmail_quote">On Mon, Jun 1, 2009 at 9:45 PM, David Rush <span dir="ltr"><<a href="mailto:kumoyuki@gmail.com">kumoyuki@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/6/2 lowly coder <<a href="mailto:lowlycoder@huoyanjinjing.com">lowlycoder@huoyanjinjing.com</a>>:<br>
<div><div></div><div class="h5">> are there any amcros that play well with destructuring bind of define-type's<br>
> ? I just want to check to see if there's a pre-existing solution before<br>
> re-inventing my own.<br>
><br>
> I find myself writing way too much code of the form:<br>
><br>
> (define-type foo a b)<br>
> (define-type bar c d)<br>
><br>
> (lambda (x)<br>
>   (let ((c (bar-c x) (d (bar-d x)))<br>
>     (let ((a (foo-a a) (b (foo-b b)) ...<br>
<br>
</div></div>This is the kind of thing where macros get over-used<br>
<br>
(define (with-foo f body) (body (foo-a f) (foo-b f)))<br>
<br>
david<br>
<font color="#888888">--<br>
GPG Public key at <a href="http://cyber-rush.org/drr/gpg-public-key.txt" target="_blank">http://cyber-rush.org/drr/gpg-public-key.txt</a><br>
</font></blockquote></div><br>