Higher Order Messages

30 views
Skip to first unread message

robert johnson

unread,
Jun 28, 2015, 5:12:53 AM6/28/15
to newspeak...@googlegroups.com
Hope this isn't too "Lambda-The-Ultimate", but I was wondering what (-if any) thoughts on using higher-order--messages with Newspeak?

Gilad Bracha

unread,
Jun 28, 2015, 11:14:10 AM6/28/15
to newspeak...@googlegroups.com
 
I'm not sure how to interpret the phrase 'higher-order messages'.   If it is just  higher-order functions as in functional programming, well, the Smalltalk family has been doing this since at least 1976. The workhorses of the collection API, collect:, select: etc.  do exactly that. It is good and it is routine.

If you mean messages containing selectors, as in perform: #aSelector, well, that entails reflection, which is fine too, but should be used with restraint because it can be costly.

Or do you mean sending messages as part of messages between actors? These could be sent as blocks or selectors.

In all cases, there is a trade off between conciseness/reusable code, and readability. Higher order code is neat, but gets harder to read as one uses it more systematically, because the level abstraction can rise to the stratosphere (as in some Haskell code).  I tend to like that sort of thing, but it needs good documentation and some restraint.
Reply all
Reply to author
Forward
0 new messages