Ever since I've read SICP I find myself reimplementing LISP features when programming in Sepples. I'm constantly struggling between linking against Boost or writing my own, lighter equivalents of it's features.
The problem isn't with ability but with time and the flexibility.
For example: I wrote a "functor to function pointer adapter" which has half the overhead of the Boost equivalent. With Sepplesox features could be modified to enable functor in-lining.
I had to roll my own due to performance reasons but I constantly catch myself writing simple functors when a one-liner with Boost::Lambda would suffice. Come to think of it, I need to check if my adapter works with Boost::Lambda and what's the lambda's overhead.
Name:
Anonymous2009-08-29 9:36
I find myself reimplementing LISP features when programming in Sepples
#define (+ plus(
int plus(int, int);
main()
{
printf("%d\n", (+ 2, 3));
}
int plus(int x, int y)
{
return x + y;
}
something like this? it probably doesn't work, i didn't bother testing
Name:
Anonymous2009-08-29 9:48
>>5
Closures and currying. I have a couple of functions with lots of parameters. Some of their arguments are supplied during run-time. The resulting partially evaluated function has to be passed to a bunch of different libraries which accept only a particular type of a C function pointer. Libraries are written is C, C++, FORTRAN. App is in C++. See >>6.