Express What, not How.

Alex Shinn foof at synthcode.com
Fri Oct 17 02:00:15 EDT 2003


At Fri, 17 Oct 2003 05:45:29 GMT, Raffael Cavallaro wrote:
> 
> In article <87ekxciphd.wl at strelka.synthcode.com>,
>  Alex Shinn <foof at synthcode.com> wrote:
> 
> > We use adjectives and adverbs to modify existing words
> > without needing to come up with new words, and build further with noun
> > clauses and prepositions.  So you can both "run quickly" and "swim
> > quickly," which is analogous to a higher order function (quickly)
> > working on two existing functions (run and swim).
> 
> I think you miss the point - "quickly" is itself a _name_ for an 
> abstract modifier. If this is the analog of a higher order function, it 
> is a _named_ higher order function, not an anonymous one.

I was making the analogy that verbs are functions (any functions).
"run" is thus a function of one argument (the person running).
"quickly" is as we both say an HOF which acts on run.  My point is the
result of applying the HOF gives us "run quickly" which is itself a
function, and an anonymous one at that because "run quickly" is not a
name but a visible application of an HOF.  It's exactly equivalent to

  (memoize run)

whereas the named version would require you to define externally

  (define run-memoized (memoize run))

a technique which quickly begins to clutter your language with names
like "swint."

-- 
Alex





More information about the Python-list mailing list