Jonathan Bartlett wrote:
Just thought you all might be interested in an article I just finished
about higher-order functions, and their use in Scheme and C:
http://www-128.ibm.com/developerwork...-highfunc.html
This is part of a series of articles I'm writing about functional
programming and how it can be used to even in procedural languages.
This even includes a section on object-oriented programming in C (not
C++) and Scheme.
Mostly, it reads like a Scheme advertisement -- "If
you want Lisp, you know where to find it." The C code
could do with some cleaning up; in particular, the manual
imitation of a closure invokes undefined behavior. It is
flat-out incorrect to invoke a function like
int nextval(void *environment);
via a function pointer described as
typedef void * (*generic_function)(void *, ...);
without first converting the pointer to agree with the
type of the called function. And no, this isn't some kind
of "academic" concern, pertinent only to the DeathStation
line: there are real computers on which this will fail.
--
Er*********@sun.com