[FoRK] The grand scheme of things...
<jbone at place.org> on
Sat Nov 3 20:15:15 PDT 2007
On Nov 3, 2007, at 6:47 AM, Andy Armstrong wrote:
> On 3 Nov 2007, at 00:34, Jeff Bone wrote:
>> Yeah, that's a snippet of something I actually wrote recently.
>> And yeah, it actually made sense at the time. ;-)
> It's not that higher-order apart from a bit of currying is it? I
> don't know Python - am I missing something sexy?
It's not particularly higher-order, but it's a heavily deconstructed
bit of list manipulation, and reads fairly declaratively. The only
higher-order functions are slurp(), run(), and the definitions of s_
() and _s() --- the latter two only in the sense of passing the fed()
predicate to filter. The lambdas weren't strictly speaking necessary
in all cases...
> I don't really know Python (thought it was Ruby at first...) but
> those top level lambda assignments are just normal method
> definitions in disguise, yes? They don't appear to need to be lambdas.
In some cases that's --- I could've used defs. This was a lot more
concise, though. And again, it wasn't until I started looking at all
of these things as little pieces to be recombined that I could "see"
how to calculate aa, ss, as, and sa. I'm probably missing a large
and critical part of the explanation here, but that was sort of the
point. This is NOT good Python --- but it was a (successful)
experiment in pushing a notation as far as possible in a particular
direction in order to *think* about the problem in an out-of-the-box
sort of way.
I really do believe that the constraints of syntax and notation
imposed by a given programming language seriously impact how we
perceive and therefore address certain problems.
> OK - it's obviously more complex than I thought - I can't see how
> aa, as, sa, as get called.
Ah, well, that's because it's a snippet. ;-)
More information about the FoRK