[racket] can't provide both #:constructor-name and #:extra-constructor-name ?

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Mon Jun 18 17:42:19 EDT 2012

In "define-struct" and "struct", should I be able to provide both 
"#:constructor-name" and "#:extra-constructor-name"?

Both of the following programs give me an error on the last form, under 
Racket 5.2.1.

Program #1:

#lang racket/base

(define-struct myc (field1) #:constructor-name       make-myc-c)
(define-struct mye (field1) #:extra-constructor-name make-mye-e)

(define-struct myce (field1)
   #:constructor-name       make-myce-c
   #:extra-constructor-name make-myce-e)
;; ERROR: define-struct: multiple #:constructor-name or 
#:extra-constructor-name keys specification#<syntax:8:2 
#:extra-constructor-name> in: "#:constructor-name or 
#:extra-constructor-name keys"

Program #2:

#lang racket/base

(struct myc (field1) #:constructor-name       make-myc-c)
(struct mye (field1) #:extra-constructor-name make-mye-e)

(struct myce (field1)
   #:constructor-name       make-myce-c
   #:extra-constructor-name make-myce-e)
;; ERROR: struct: multiple #:constructor-name or 
#:extra-constructor-name keys specification#<syntax:8:2 
#:extra-constructor-name> in: "#:constructor-name or 
#:extra-constructor-name keys"

Neil V.


Posted on the users mailing list.