From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.esat.net!nslave.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Impressing colleagues with Lisp - looking for stories from the trenches References: <3229353106350910@naggum.net> Mail-Copies-To: never From: Erik Naggum Message-ID: <3229381214862157@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 39 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 03 May 2002 02:20:15 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1020392415 193.71.199.50 (Fri, 03 May 2002 04:20:15 MET DST) NNTP-Posting-Date: Fri, 03 May 2002 04:20:15 MET DST Xref: archiver1.google.com comp.lang.lisp:32678 * Erik Naggum > (setf (user-id (find-user "username")) 666) * Christopher Browne | Interesting. | | The one problem I'd see with this is that it would get awfully | inefficient if you try to do a more extensive update Well, you seldom do this in the first place because it is so inefficient. Only in the very rare case would you ever want to change a user's uid. But that you could express the operation abstractly simply as a setf on the innocuous accessor, is sufficiently elegant that a competent sysadmin would see the sheer charm of it. I mean, the whole point of this thread is to share stories of how we convinced people that Common Lisp was good, right? I did just that. *sigh* | (setf (id1 (find-user "id1")) 666 | (id2 (find-user "id2")) 667 | (id3 (find-user "id3")) 668 | (id4 (find-user "id4")) 669) I am not sure what you think this does, but my example has find-user, which takes a user-name and returns all the data about a user in a user object, and user-id which is an accessor into the object. The fact that it has access to the old value and can do more intelligent things than just setting the slot in the user information was kind of the key here. | The scheme would get rather "old" rather quick if you had to rewrite | /etc/passwd each time you do a component of the SETF... That is a separate layer of abstraction entirely and is not even handled. The accessors into the user database are already sufficiently abstract in, e.g., Linux that editing /etc/passwd is deprecated and discouraged. -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief. 70 percent of American adults do not understand the scientific process.