[plt-scheme] requiring structures

From: Doug Orleans (dougorleans at gmail.com)
Date: Sat Mar 18 20:36:34 EST 2006

I just had an idea, you tell me if it's a bright idea or a stupid idea...

You can currently say "(provide (struct foo (bar baz)))" as a
shorthand for providing "struct:foo", "foo?", "make-foo", "foo-bar",
"set-foo-bar!", "foo-baz", "set-foo-baz!", and "foo" (as syntax).
How about allowing the same thing in "require"?  For example:

  (require (only "foo.ss" (struct foo (bar))))
  (require (prefix-all-except foo: "foo.ss" (struct foo (bar baz))))
  (require (rename "foo.ss" (struct foo (bar baz)) (struct oof (rab zab))))

OK, I'll admit that I only really want the first one, but the other
two seem like natural extensions.

--dougorleans at gmail.com


Posted on the users mailing list.