Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cme!cam!ARTEMIS From: miller@cam.nist.gov (Bruce R. Miller) Newsgroups: comp.lang.lisp Subject: Re: Common Lisp Package System Considered Harmful Message-ID: <2865277201@ARTEMIS.cam.nist.gov> Date: 18 Oct 90 22:20:01 GMT References: <271E0D40.451E@wilbur.coyote.trw.com> Sender: news@cam.nist.gov Followup-To: comp.lang.lisp Organization: NIST - Center for Computing and Applied Mathematics Lines: 102 In article <271E0D40.451E@wilbur.coyote.trw.com>, Scott Simpson writes: > In article <2865200060@ARTEMIS.cam.nist.gov> miller@cam.nist.gov writes: > ... > I agree that the intent that I intended to use packages for and the > intent they were designed for are probably quite different. I don't > know what packages were designed for. I have been told that they are > to be used for separating large subsystems of code. As far as I know, that's exactly what they're for. > The point I have > been trying to make is that the information hiding granularity of > packages is way too coarse and no other mechanism in Lisp can give me > the granularity I want (i.e., class based) easily. I don't find > packages very useful and I wouldn't cry a tear if they were simply > removed from the language. Just because packages doesn't solve the particular problem of the moment doesn't mean they're not useful. I would miss them. > I don't know if I agree that CLOS deals > with information hiding. How do you mean? Exactly in this sense: > >One point is that, in Lisp, nothing is REALLY hidden -- some things are > >just a little less visible than others. Want a non-exported symbol from > >a package? Use two colons. Want to get at an unapproved slot from a > >clos instance? Just use slot-value. > > Yes. I hate this. The double colon is way too similar to the single > colon. I can concede that for efficiency reasons or some such it is > non unreasonable to have back doors that can break the abstraction > barrier. ... Well, I dont mind it a bit. Double colons are noticable to me. I surely notice when I type them in! Ditto slot-value. And although given what Lisp is, it would surely introduce inefficiencies to try to introduce firewalls, I seriously doubt that that has anything to do with the lack of them. Who wants them? (besides you I mean :> ) > >On the one hand, I think that packages are (very) useful at a coarse > >grain: for example at the application level. I've never written an > >application with more than 2 packages and even those were cases where > >the one might be used as a separate set of tools. [I do often write > > If you hardly ever use packages, why do you find them so useful? ? I ALWAYS use packages -- I just dont find myself needing to use more than 2 in any given app. I find them useful for just what I said: separating applications and gross layers within an application. > > ... You just dont call the internals by virtue of your strength of > >will and extraordinary discipline! > > Exactly. Strength of will and extraordinary discipline. You hit the > nail on the head. This is *exactly* what I am trying to avoid. Why? Besides, I like being virtuous!:> > Besides, if we didn't cherish information hiding, language protection > and ease of uses why don't we all go back to programming in assembly > language? They all are Turing machine equivalent anyway. Right? I > don't think that the difference between external and internal > functions should just be that one is documented and the other isn't. > We need language features to help in providing protection and ease of > use. FMHT (for my humble tastes), I think you go a bit too far here. > >As you've seen, using too many packages within the same program gets > >hairy. But, I dont think that CLOS really attempts to enforce any kind > >of barrier, and packages seems to be at the wrong level for what you > >want --- lisp itself isn't really into firewalls in any case. > > OK. Here you say that CLOS doesn't enforce any barrier. I agree. Also > you are right. Lisp isn't into firewalls. This is my complaint. Emphasis on ENFORCE. I guess if you REALLY want that much of a barrier, you've just got to use a multitude of packages and a multitude^2 of exports and not USE the packages within each other. You've got to say what is OK and not OK anyway -- what's wrong with export? > I think most Lisp users suffer in the same way. > Scott Simpson TRW scott@coyote.trw.com I'm certainly not `most' but I'm not suffering. bruce - - - - -- - - dumb posting software - - - - - -