[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What if...
On Mon, 2002-08-12 at 07:44, Jonathan Hseu wrote:
> Cool. But... what if I want to (use/export/mangle)?
> I guess I could put an extra (use/export) at the end of the file, but
> perhaps a better solution is necessary.
>
> It also becomes a bigger issue when we get selective imports.
> For instance:
> (use/pick tests/blah $pi)
>
> But what if we wanted to use/pick/mangle/export?
Hello! I'm the guy who first implemented (export ...) and (use ...) in
Proto.
My original intention was add extra clauses to (use ...), similar to
those in Dylan:
(use foo/bar
(rename f1 bar-f1)
(exclude f2))
(use foo/bar
(prefix foo-bar-))
(use foo/bar
(export f1 (rename f2 foo-bar-f2) f3))
(export
g1
(rename internal-g2 g2)
g3)
...and so on. This keeps the entire import/export sytax in just two
special forms, each of which implements a "little language". And it
saves you the trouble of implementing 20 redundant (use/export/mangle
...) forms. Dylan actually does a pretty good job with selective
importing, name mangling and exporting. I don't like introducing
special forms with "/" in the name unless absolutely necessary--it seems
to be "code smell" indicating that I haven't found the right abstraction
to cover two special cases.
Anyway, that's just my two cents... :-)
Cheers,
Eric