On Wed, Sep 15, 2010 at 19:35, Matthias Felleisen <matth...@ccs.neu.edu>wrote:
> > On Sep 15, 2010, at 1:33 PM, Laurent wrote: > > > > > This hack will have limitations, > > > > Do you have specific ones in mind? > > > > but you could take this one step > > further by having the argument to your macro be an identifier and then > > taking the symbolic name of the identifier and passing that to > > dynamic-require (at compile time) to get the actual class you want. > > > > That is a nice idea, I'll try that. > > How else do you ensure that the object is an instance of the class? But > yes, I am stumped and surprised. Without that, I don't, that's right, though no more than does `send'. I could had a check before the call to class->singleton or instead of asking for an expression that generates an object of class%, I could only ask for the arguments to `new', but this would be too restrictive I think. But I'm wondering if multiple calls to define-class->singleton would then cause multiple calls to dynamic-require, which would take too much time... ? Another question: If I use: (datum->syntax #'id n #'id #'id #'id) that makes check-syntax say that `get-the-val' comes from `current-a'. Is this ok or is there anything better to do?
_________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users