Newsgroups: alt.lang.design,comp.lang.c++,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!news.sprintlink.net!pipex!uunet!harlequin.com!epcot!norvig
From: norvig@harlequin.com (Peter Norvig)
Subject: Re: Comparing productivity: LisP against C++ (was Re: Reference Counting)
Message-ID: <D1A1w3.E7r@harlequin.com>
Summary: Simple Image inversion program in Lisp
Sender: usenet@harlequin.com (Usenet Maintainer)
Nntp-Posting-Host: tigris
Organization: Harlequin, Inc., Menlo Park, CA USA
References: <vogtD12y8D.HLL@netcom.com> <3d5alh$6j7@celebrian.otago.ac.nz> <vrotneyD13o6z.92L@netcom.com>
Date: Fri, 23 Dec 1994 18:55:15 GMT
Lines: 24
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:104725 comp.lang.lisp:16178


I agree with all those who said that a little utility like this is not an
appropriate test of productivity.  However, let me say that it took me
1 minute and 30 seconds, using some tools that are not part of Common Lisp, but
which I define in my tools library.  Here's my solution (it assumes that the
images are written as Common Lisp arrays):

(defun invert-image (in-file out-file)
  (read-eval-print :in in-file :out out-file
		   :eval #'(lambda (image) (map-array #'- image))))


=================================================================
Peter Norvig                          
Harlequin Inc.                        Email: norvig@harlequin.com
1010 El Camino Real, Suite 310        Phone: 415-833-4022
Menlo Park CA 94025                   Fax:   415-833-4111


-- 

=================================================================
Peter Norvig                          
Harlequin Inc.                        Email: norvig@harlequin.com
