Path: utzoo!mnetor!uunet!ncc!alberta!ubc-cs!faculty.cs.ubc.ca!manis From: manis@faculty.cs.ubc.ca (Vincent Manis) Newsgroups: comp.lang.scheme Subject: Re: Re : set in Scheme Message-ID: <2491@ubc-cs.UUCP> Date: 10 May 88 02:58:37 GMT References: <12073@shemp.CS.UCLA.EDU> Sender: nobody@ubc-cs.UUCP Reply-To: manis@faculty.cs.ubc.ca (Vincent Manis) Distribution: na Organization: UBC Department of Computer Science, Vancouver, B.C., Canada Lines: 30 Well, putting my radical hat on, not only is set evil, but also set!. Only non-destructive programming practices are safe, and everything else inevitably leads to disaster. But back here in the real world, one occasionally wants global variables. Those you can have via set! and define. I guess the frequency with which I use set in Lisp can be best judged by the fact that I hadn't realised it was absent in Scheme until reading the original posting on this subject. There are good reasons for omitting it. First of all, set makes programs opaque in that one has no idea which variable is getting modified. More to the point, Scheme dispenses with value cells, so implementing set would be non-trivial in most Schemes (though Chez Scheme's "boxes" might make it easier). My eyes glaze over when I see two levels of backquote in a macro definition, so I don't know how effective the posted solution is. However, my choice is the humble property list. Still not terribly structured, but efficiently implemented and a bit more modular (different bits of code can use plists without interfering, so long as they use different pnames). Of course, the *right* way to do this is probably a hash table or tree... Vincent Manis | manis@cs.ubc.ca The Invisible City of Kitezh | manis@cs.ubc.cdn Department of Computer Science | manis@ubc.csnet University of British Columbia | {ihnp4!alberta,uw-beaver,uunet}! <> | ubc-cs!manis