[plt-scheme] (provide ...) question

From: Todd O'Bryan (toddobryan at gmail.com)
Date: Tue May 18 08:44:49 EDT 2010

I have a struct that I'd like to provide from a module, but I'd like
to provide a different constructor to modules that require it. Here's
a simple example:

(define-struct city-line (city state zip zip+4))

(define better-make-city-line
  (case-lambda
    [(city state zip zip+4)
     (make-city-line city state zip zip+4)]
    [(city state zip)
     (make-city-line city state zip "")]))

I tried this:

(provide (except-out (struct-out city-line)
                     make-city-line)
         (rename-out [better-make-city-line make-city-line]))

but that doesn't seem to do it.

Is there a way to do such a thing? Am I close?

Thanks,
Todd


Posted on the users mailing list.