Higher Order Function Question
Alex Peake
apeake@REDACTED
Fri May 17 01:37:18 CEST 2002
Thanks both of you for your help.
I chose the:
(Fn)(Args)
rather than:
apply(Fn,[Args])
It seems simpler, more elegant (am I missing something)?
I saw no reference to this method (of apply) in the book.
Alex
> -----Original Message-----
> From: owner-erlang-questions@REDACTED
> [mailto:owner-erlang-questions@REDACTED]On Behalf Of Happi
> Sent: Thursday, May 16, 2002 12:45 AM
> To: erlang-questions@REDACTED
> Subject: Re: Higher Order Function Question
>
>
>
> Thomas Arts wrote:
> > ps. You don't need to use three apply's, I guess you want to
> > recursively apply disjoin on the rest of the functions:
> >
> > fun(Args) ->
> > apply(Fn, [Args]) orelse
> > apply(apply(disjoin, [FnTail]), [Args])
> > end;
> >
> > is equal to:
> >
> > fun(Args) ->
> > apply(Fn,[Args]) orelse
> > apply(disjoin(FnTail),[Args])
> > end;
> >
>
> wich is equal to:
> fun(Args) ->
> (Fn)(Args) orelse (disjoin(FnTail))(Args)
> end
>
> Perhaps you wanted:
> fun(Args) ->
> apply(Fn,Args) orelse
> apply(disjoin(FnTail),Args)
> end
>
> /Erik
> Praeterea censeo "0xCA" scribere Erlang posse.
>
>
>
>
More information about the erlang-questions
mailing list