[racket] struct constructor pitfalls

From: David T. Pierson (dtp at mindstory.com)
Date: Wed May 29 23:48:13 EDT 2013

On Wed, May 29, 2013 at 03:12:45PM -0400, Anthony Carrico wrote:
> It seems like the purpose of #:constructor-name is to get the default
> contsructor out of the way, so you can customize it:
> 
> #lang racket
> 
> (struct hello (a b c)
>   #:constructor-name hello-rep
>   )
> 
> (define (hello) (hello-rep 1 2 3))
> 
> But this gives the error:
>   duplicate definition for identifier in: hello

Are you aware of #:omit-define-syntaxes ?

 (struct hello (a b c)
   #:constructor-name hello-rep
   #:omit-define-syntaxes)

David

Posted on the users mailing list.