Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!samsung!think.com!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!markf From: markf@zurich.ai.mit.edu (Mark Friedman) Newsgroups: comp.lang.scheme Subject: Re: modularization of scheme code Message-ID: Date: 4 Mar 91 17:43:00 GMT References: <5241@umbc3.UMBC.EDU> Sender: news@ai.mit.edu Reply-To: markf@zurich.ai.mit.edu Organization: M.I.T. Artificial Intelligence Lab. Lines: 34 In-reply-to: alex@umbc4.umbc.edu's message of 3 Mar 91 20:26:43 GMT In article <5241@umbc3.UMBC.EDU> alex@umbc4.umbc.edu (Alex S. Crain) writes: I would rather not make my locally used functions and data structures public if I don't have to, both to avoid cluttering the namespace and just for general neatness. Scheme doesn't provide a way (that I know of) of hiding anything except by nesting itside a function, and even if I wrapped the entire module inside of letrec body I don't know how to make the date structures permentent, and I only get one entry point (yuk). Using your example try something like the following: (define create-window #f) (define delete-window #f) (let () (define screen-data (make-vector ...)) (set! create-window (lambda ...)) (set! delete-window (lambda ...))) The assigned values of create-window and delete-window can access screen-data with impunity whereas the user of those procedures has no access to screen-data. -Mark -- Mark Friedman MIT Artificial Intelligence Lab 545 Technology Sq. Cambridge, Ma. 02139 markf@zurich.ai.mit.edu