[racket] define-generics #:defaults

From: Bert De Ketelaere (bedeke at hotmail.com)
Date: Thu Jul 11 01:36:16 EDT 2013

Vincent, Carl,

I stumbled on another workaround, defining the specific methods outside of define-generics, and then rebinding them withing #:defaults.
Anyway, it was only for a small exercise.

Thanks for the quick reply,

Bert

From: cce at ccs.neu.edu
Date: Wed, 10 Jul 2013 13:32:50 -0400
Subject: Re: [racket] define-generics #:defaults
To: bedeke at hotmail.com
CC: users at racket-lang.org

Bert,

I've just pushed a fix to this bug, which I had written previously as part of some other work I'm doing with generics.  As Vincent already pointed out, if you're using a released version of Racket and updating to the new code is problematic, you can always work around the bug with your own wrapper functions.



Thanks for the report,Carl Eastlund

On Wed, Jul 10, 2013 at 5:03 AM, Bert De Ketelaere <bedeke at hotmail.com> wrote:





Helo,

in the documentation it is mentioned that the syntax for define-generics #:defaults is the same as for struct #:methods:
http://docs.racket-lang.org/reference/struct-generics.html#%28form._%28%28lib._racket%2Fgeneric..rkt%29._define-generics%29%29


and #:methods specifies that define/generic can be used to bind the generic method:
http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29



but unfortunately using define/generic in #:defaults is a syntax error.
Is it possible to access the generic method from inside #:defaults definitions?

Groeten,
Bert
 		 	   		  

____________________

  Racket Users list:

  http://lists.racket-lang.org/users



 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130711/11bf1ffe/attachment.html>

Posted on the users mailing list.