[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: member returns list
From: |
Emanuel Berg |
Subject: |
Re: member returns list |
Date: |
Sun, 06 Sep 2015 04:57:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Random832 <random832@fastmail.com> writes:
> How is this different from memq itself
> appearing repeatedly?
`memq' is a function. What should not be repeated is
data (in your case the a function passed as an
argument).
> Or the substring -eq appearing repeatedly in your
> version in symbols like member-eq and assoc-eq?
Those are not my versions. I made the examples to show
how it could look. It doesn't, which is good.
> It's just like using a naming convention, only it
> makes it possible (and obvious that it is possible)
> to substitute the comparison function with your own
> function. It's simpler because instead of having two
> functions to do two things with no obvious way to do
> the same thing with anything else, you have one
> function that can easily discoverably do anything.
There should be one function that can do everything
but common patterns should be factored out into
interfaces and/or optimizations.
Code shouldn't look like this:
(do-this 1 2 3)
(do-this 1 2 3)
(do-this 1 2 3)
But like this:
(defun do-the-one-two-three-thing ()
(do-this 1 2 3) )
(loop repeat 3 do (do-the-one-two-three-thing))
--
underground experts united
http://user.it.uu.se/~embe8573
- Re: member returns list, (continued)
- Re: member returns list, Emanuel Berg, 2015/09/02
- Re: member returns list, Michael Heerdegen, 2015/09/02
- RE: member returns list, Drew Adams, 2015/09/02
- Re: member returns list, Marcin Borkowski, 2015/09/02
- Re: member returns list, Emanuel Berg, 2015/09/03
- Re: member returns list, Marcin Borkowski, 2015/09/04
- Re: member returns list, Emanuel Berg, 2015/09/05
- Re: member returns list, Random832, 2015/09/05
- Re: member returns list, Emanuel Berg, 2015/09/05
- Re: member returns list, Random832, 2015/09/05
- Re: member returns list,
Emanuel Berg <=
- Message not available
- Re: member returns list, Pascal J. Bourguignon, 2015/09/05
- Re: member returns list, Emanuel Berg, 2015/09/05
- Re: member returns list, Robert Thorpe, 2015/09/08
- Re: member returns list, Pascal J. Bourguignon, 2015/09/08
- Re: member returns list, John Mastro, 2015/09/08
- Re: member returns list, Emanuel Berg, 2015/09/09
- Message not available
- Re: member returns list, Pascal J. Bourguignon, 2015/09/06
- Re: member returns list, Emanuel Berg, 2015/09/06
- Message not available
- Re: member returns list, Pascal J. Bourguignon, 2015/09/06
- Re: member returns list, Pascal J. Bourguignon, 2015/09/06