From: Marco Antoniotti
Subject: Names for functions
Date: 
Message-ID: <y6cpu1pfrn3.fsf@octagon.mrl.nyu.edu>
Hi

I am sure there are "traditional" names for these two higher order
functions, but they escape me right now.

I wrote

(defun multiplex (value &rest functions)
  (loop for f in functions
	collect (funcall f value)))

and

(defun apply-n (n f &rest args)
  (loop repeat n
	collect (apply f args)))

how would you call these functions?

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.

From: Takehiko Abe
Subject: Re: Names for functions
Date: 
Message-ID: <keke-2803022315110001@solg4.keke.org>
In article <···············@octagon.mrl.nyu.edu>, 
Marco Antoniotti wrote:

> I am sure there are "traditional" names for these two higher order
> functions, but they escape me right now.
> 
> I wrote
> 
> (defun multiplex (value &rest functions)
>   (loop for f in functions
>         collect (funcall f value)))
> 
> and
> 
> (defun apply-n (n f &rest args)
>   (loop repeat n
>         collect (apply f args)))
> 
> how would you call these functions?

Instead of going for higher order, how about staying lower?
Personally I'd prefer to see LOOP or MAPCAR form in source
rather than multiplex with documentation.

OTOH if those abstractionss are needed for your particular
application, I guess you can come up with some ad-hoc names
easily.

-- 
<keke at mac com>
Are you sure that sound might want to have an idiot?
From: Marco Antoniotti
Subject: Re: Names for functions
Date: 
Message-ID: <y6c4rj0n5ar.fsf@octagon.mrl.nyu.edu>
····@ma.ccom (Takehiko Abe) writes:

> In article <···············@octagon.mrl.nyu.edu>, 
> Marco Antoniotti wrote:
> 
> > I am sure there are "traditional" names for these two higher order
> > functions, but they escape me right now.
> > 
> > I wrote
> > 
> > (defun multiplex (value &rest functions)
> >   (loop for f in functions
> >         collect (funcall f value)))
> > 
> > and
> > 
> > (defun apply-n (n f &rest args)
> >   (loop repeat n
> >         collect (apply f args)))
> > 
> > how would you call these functions?
> 
> Instead of going for higher order, how about staying lower?
> Personally I'd prefer to see LOOP or MAPCAR form in source
> rather than multiplex with documentation.
> 
> OTOH if those abstractionss are needed for your particular
> application, I guess you can come up with some ad-hoc names
> easily.

As a matter of fact, I pretty much went the way you described.  I had
a lot of LOOP/MAPCARs doing exactly the above, wrapped them up in
ad-hoc names and realized that they are really higher order idioms.

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.