From ... From: Erik Naggum Subject: Re: Elegant solution asked Date: 1997/03/06 Message-ID: <3066630268497107@naggum.no>#1/1 X-Deja-AN: 223477091 References: <331DF5AD.128B@wrq.com> <3066591221451362@naggum.no> <331e791a.4404553@news.glo.be> mail-copies-to: never Organization: Naggum Software; +47 2295 0313; http://www.naggum.no Newsgroups: comp.lang.lisp * Francis Leboutte | Maybe you'll prefer this: | | USER<10> (defun circular (list) | (let ((new-list (copy-list list))) | (rplacd (last new-list) new-list) | new-list)) | CIRCULAR-LIST | USER<11> (mapcar #'list (circular '(z)) '(a b c)) | ((Z A) (Z B) (Z C)) I thought `repeatingly' (or `repeatedly', which I'm told is better a name) was neat, because it provides a means to let a mapping function map repeatedly over the object(s) that were the functions' arguments. calling it `circular' or `circular-list' says what it is, but not what it means; there is no abstraction of purpose in sending it a list of the arguments, quoted or otherwise. actually, I think using a circular list with a mapping function is a little "dangerous" unless there are other arguments that have finite length, and it is also somewhat counter-intuitive to send a circular list to a mapping function in the first place. all of this led me to discard the implementation-like name (which I used at first, too), and then to use a more functionally abstract name. I would like to hear opinions on whether this is good style, be it called by a name that reflects the implementation or the purpose. #\Erik -- if you think big enough, you never have to do it