|
Boost Users : |
From: Stephen Gross (sgross_at_[hidden])
Date: 2006-04-04 13:28:51
I've got an idea for a toolkit that uses boost::lambda to let you write
'equations' on the fly in c++. For instance, consider the following
pseudo-code:
==================
Equation e = x + y;
print e(x -> 5, y -> 10) // Prints 15
e = x - y
print e(x -> 5, y -> 10) // Prints -5
Equation d = eq(e) + z
print d(x -> 1, y -> 2, z -> 3) // Prints 2
==================
The idea is that you can encapsulate an algebraic function in a standalone
'Equation' instance, and dynamically reassign that equation. It's built off
of boost::lambda (of course), but it lets you name the variables rather than
just refer to them with the standard placeholders (_1, _2, etc.). Is it
worthwhile for me to post the toolkit code on this group?
Thanks,
--Steve
Stephen Gross
Case Western School of Medicine
Cleveland, OH
"By Grabthar's hammer, by the sons of Worvan, you shall be avenged." - Dr.
Lazarus
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net