On 15 December 2012 20:01, Gilad Bracha <
gbr...@gmail.com> wrote:
> It would of course have been helpful to establish some context here. But
> maybe this was a point free message ...
>
> Anyone who finds the original message unclear should look up "Point free
> programming" on their favorite search engine.
>
> To the substance: these techniques are sometimes useful, but I feel they are
> abused as often as not. We could have better support for operations on
> closures such as composition. However, divorcing code from concrete data is
> not in fact a good idea in general. Currying , for example, is vastly
> overrated in my view, and doesn't fit well with keyword messages or dynamic
> typing. So I am not clear how we'd emphasize this in Newspeak, and I doubt
> if we should.
Partial application looks so neat in Haskell (the origin of pointless
programming (I simply cannot resist saying that!)) because under the
hood all functions are already curried. Also, a function's entire name
appears to the left of its arguments. However, Newspeak and Smalltalk
have "delocalised" selectors/function names, where parts of the
function name are interspersed with the arguments to the function.
Point-free programming with anything other than unary selectors would
look very odd.
But even without considering the syntax side of things, point-free
style in Haskell is not universally accepted/admired because it can be
extremely hard to read. The data flow in a computation is entirely
hidden, so the programmer has to connect the dots mentally in an
attempt to reconstruct such flow.
I've written a fair amount of monadic code in Smalltalk (not, alas, in
Newspeak). It certainly makes heavier use of closures than standard
Smalltalk, so I ended up adding things like #compose: to BlockClosure.
The resulting code's easy enough to read, and doesn't require any
additional language machinery: it's just more library code. Vassili
Bykov's written about these kinds of things before, on his 3 + 4 blog,
starting (IIRC) with
http://blog.3plus4.org/2007/03/23/currying-in-smalltalk/.
One could also add #compose: to Symbol, I suppose: (#max compose:
#asSet) value: #(1 1 2 3).
frank