|
|
#1 |
|
|
#'(lambda (x y) (member x y :test 'equal)) ? (eq is to memq as equal is to ...) Juliusz Chroboczek |
|
|
#2 |
|
|
> What is the canonical name of > #'(lambda (x y) (member x y :test 'equal)) > ? > (eq is to memq as equal is to ...) In Common Lisp, there is none. In some earlier Lisp versions, the function you are asking about was called "member", but with no keyword argument, and the #'eql test, now the default, did not even exist. -- Dave Seaman Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling. <http://www.commoncouragepress.com/index.cfm?action=book&bookid=228> |
|
|
#3 |
|
|
DS> In some earlier Lisp versions, the function you are asking about DS> was called "member", but with no keyword argument, and the #'eql DS> test, now the default, did not even exist. Any suggestions for a good name? I'm finding myself writing the above way too often. (Perhaps I should be interning my strings...) Juliusz Chroboczek |
|
|
#4 |
|
|
In article <tpr7tww9gv.fsf@lanthane.pps.jussieu.fr>,
Juliusz Chroboczek <jch@pps.jussieu.fr> wrote: > JC> #'(lambda (x y) (member x y :test 'equal)) > > DS> In some earlier Lisp versions, the function you are asking about > DS> was called "member", but with no keyword argument, and the #'eql > DS> test, now the default, did not even exist. > > Any suggestions for a good name? I'm finding myself writing the above > way too often. (Perhaps I should be interning my strings...) (defun member-equal (x y) (member x y :test #'equal)) -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** |
|
|
#5 |
|
|
Juliusz Chroboczek <jch@pps.jussieu.fr> writes:
> JC> #'(lambda (x y) (member x y :test 'equal)) > > DS> In some earlier Lisp versions, the function you are asking about > DS> was called "member", but with no keyword argument, and the #'eql > DS> test, now the default, did not even exist. > > Any suggestions for a good name? I'm finding myself writing the above > way too often. (Perhaps I should be interning my strings...) memual? Christophe -- http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757 (set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b))) (defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge) |
|
|
#6 |
|
|
Christophe Rhodes wrote:
> Juliusz Chroboczek <jch@pps.jussieu.fr> writes: >>Any suggestions for a good name? I'm finding myself writing the above >>way too often. (Perhaps I should be interning my strings...) > > memual? "Much of the skill in writing unmaintainable code is the art of naming variables and methods. They don't matter at all to the compiler. That gives you huge latitude to use them to befuddle the maintenance programmer." - How to Write Unmaintainable Code |
|
|
#7 |
|
|
Ari Johnson wrote: > Christophe Rhodes wrote: > >> Juliusz Chroboczek <jch@pps.jussieu.fr> writes: >> >>> Any suggestions for a good name? I'm finding myself writing the above >>> way too often. (Perhaps I should be interning my strings...) >> >> >> memual? > > > "Much of the skill in writing unmaintainable code is the art of naming > variables and methods. They don't matter at all to the compiler. That > gives you huge latitude to use them to befuddle the maintenance > programmer." > - How to Write Unmaintainable Code So... mual? kenny -- Home? http://tilton-technology.com Cells? http://www.common-lisp.net/project/cells/ Cello? http://www.common-lisp.net/project/cello/ Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film Your Project Here! http://alu.cliki.net/Industry%20Application |
|
|
#8 |
|
|
Kenny Tilton <ktilton@nyc.rr.com> wrote:
> Ari Johnson wrote: >> Christophe Rhodes wrote: >>> Juliusz Chroboczek <jch@pps.jussieu.fr> writes: >>> >>>> Any suggestions for a good name? I'm finding myself writing the above >>>> way too often. (Perhaps I should be interning my strings...) >>> >>> memual? >> >> "Much of the skill in writing unmaintainable code is the art of naming >> variables and methods. They don't matter at all to the compiler. That >> gives you huge latitude to use them to befuddle the maintenance >> programmer." >> - How to Write Unmaintainable Code > > So... mual? moo. For "Member, Object equals Other one". -- Karl A. Krueger <kkrueger@example.edu> Woods Hole Oceanographic Institution Email address is spamtrapped. s/example/whoi/ "Outlook not so good." -- Magic 8-Ball Software Reviews |
|
|
#9 |
|
|
Karl A. Krueger wrote:
> Kenny Tilton <ktilton@nyc.rr.com> wrote: > >>Ari Johnson wrote: >> >>>Christophe Rhodes wrote: >>> >>>>Juliusz Chroboczek <jch@pps.jussieu.fr> writes: >>>> >>>> >>>>>Any suggestions for a good name? I'm finding myself writing the above >>>>>way too often. (Perhaps I should be interning my strings...) >>>> >>>>memual? >>> >>>"Much of the skill in writing unmaintainable code is the art of naming >>>variables and methods. They don't matter at all to the compiler. That >>>gives you huge latitude to use them to befuddle the maintenance >>>programmer." >>> - How to Write Unmaintainable Code >> >>So... mual? > > > moo. For "Member, Object equals Other one". Well, we want to make it obvious that we're dealing with the "equal" operator, so how about mmmmmmmmmmm-equal or, to make the pronunciation more obvious, just call it homer-simpson. |
|
|
#10 |
|
|
Barry Margolin <barmar@alum.mit.edu> wrote:
+--------------- | Juliusz Chroboczek <jch@pps.jussieu.fr> wrote: | > JC> #'(lambda (x y) (member x y :test 'equal)) | > Any suggestions for a good name? | | (defun member-equal (x y) | (member x y :test #'equal)) +--------------- In this case that seems quite appropriate, though I often find myself using "/" rather than "-" to indicate minor variants of functions, e.g., "member/equal" for the above, especially when the function being "specialized" (whoo!) already has one or more hyphens in its name, e.g. JOIN-STRINGS vs. JOIN-STRINGS/SQL-QUOTED or: get-bindings get-bindings/get get-bindings/post and: extract-bindings extract-bindings/single That sort of thing. Comments? -Rob ----- Rob Warnock <rpw3@rpw3.org> 627 26th Avenue <URL:http://rpw3.org/> San Mateo, CA 94403 (650)572-2607 |