<br><br><div class="gmail_quote">On Wed, Sep 15, 2010 at 19:35, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
On Sep 15, 2010, at 1:33 PM, Laurent wrote:<br>
<br>
><br>
> This hack will have limitations,<br>
><br>
> Do you have specific ones in mind?<br>
><br>
> but you could take this one step<br>
> further by having the argument to your macro be an identifier and then<br>
> taking the symbolic name of the identifier and passing that to<br>
> dynamic-require (at compile time) to get the actual class you want.<br>
><br>
> That is a nice idea, I'll try that.<br>
<br>
</div>How else do you ensure that the object is an instance of the class? But yes, I am stumped and surprised. </blockquote></div><br>Without that, I don't, that's right, though no more than does `send'.<br>I could had a check before the call to class->singleton or instead <br>
of asking for an expression that generates an object of class%,<br>I could only ask for the arguments to `new', but this would be too <br>restrictive I think.<br><br>But I'm wondering if multiple calls to define-class->singleton would <br>
then cause multiple calls to dynamic-require, which would take too<br>much time... ?<br><br>Another question: If I use:<br>(datum->syntax #'id n #'id #'id #'id)<br>that makes check-syntax say that `get-the-val' comes from `current-a'.<br>
Is this ok or is there anything better to do?<br>