[plt-dev] struct match-expander a la struct-copy
> (define-struct foo (x y)
> #:positional-constructor make-foo1
> #:keyworded-cosntrutor make-foo2)
+1
The #:positional-constructor option would be really useful for another
purpose:
I sometimes find myself creating custom constructors for structs and
providing them under contracts. I currently have to do it in two
modules to get the right names:
foo-internal.ss
#lang scheme
(define-struct foo (...))
(define (create-foo ...) ...)
(provide/contract
[struct foo ...]
[create-foo ...]))
foo.ss
#lang scheme
(require "foo-internal.ss")
(provide (except-out (struct-out foo) make-foo)
(rename-out [create-foo make-foo]))
This addition would allow me to define a struct with "make-foo/
internal" (or something) as its uncontracted constructor name and
define make-foo directly without the renaming shenanigans.
-- Dave