Subject: Re: CL (CLISP vs CMUCL) performance on Linux
From: Erik Naggum <clerik@naggum.no>
Date: 1998/01/16
Newsgroups: comp.lang.lisp
Message-ID: <3093909400487123@naggum.no>


* Sam Steingold
| I just upgraded to Linux (from w32, where I had only CLISP to chose from)
| and I am trying to choose the best CL available.  GCL compilation failed,
| and Allegro 4.3 doesn't support :key in #'reduce,

* Rainer Joswig
| Really?  What does Franz say?  This should be ***easily*** patchable.
| If necessary write your own reduce.

  well, this is what Franz, Inc, says:

Mon Sep 29 10:58:55 PDT 1997
 Patch: 0306-01.fasl
  Implements the :key argument to reduce.
 Impact: Should be minor

  I reported it as a bug the first time I actually needed it (checksum
  calculations over string buffers for various weird protocols), and it got
  fixed within a few hours with a patch available for ACL 4.3.1.  the
  normal policy of not producing patches for an old release once a new has
  been released applies, but since 4.3 for Linux is a special case, this
  means that there is no patch for ACL 4.3 for Linux.  while this is sad
  for Linux users, I'd like to point out that a bug in `run-shell-command'
  that I ran into and thought was quite serious (it quietly truncated the
  command line) got special treatment because I felt it important that
  Linux users should not suffer this bug, and, to my grateful surprise,
  Franz, Inc, agreed and patches for all 4.3 platforms were made.  please
  do check pub/patches on ftp.franz.com.

  I did code some advice around `reduce', but it's easier to write your own
  `reduce' than to use this advice if you use :start or :end or :from-end
  _and_ rely on the order that the :key function is called on elements for
  side effects or that function may signal an error on elements outside of
  the range from :start to :end.  the advice I'm currently using for 4.3
  Linux follows.  (I have set excl:*compile-advice* globally to t, so the
  advice will be compiled automatically when defined.)

(in-package :excl)

(unless (member :key (arglist #'reduce) :test #'string=)
  (defadvice reduce (support-key :before)
    (let ((key (getf (cddr arglist) :key)))
      (when key
	(remf (cddr arglist) :key)
	(setf (second arglist)
	  (map 'vector key (second arglist)))))))

  loading this piece of advice will not hurt you after you have upgraded to
  a version of Allegro CL that supports the :key argument to `reduce'
  natively, so it is at least safe in that regard, although it is not an
  attempt to make `reduce' conformant to ANSI CL and so _could_ hurt you
  before you upgrade in pathological cases.  you have been warned.
  
#:Erik
-- 
The year "98" was new 1900 years ago.  |  Help fight MULE in GNU Emacs 20!
Be year 2000 compliant, write "1998"!  |  http://sourcery.naggum.no/emacs/