-
Notifications
You must be signed in to change notification settings - Fork 6
/
README
34 lines (18 loc) · 1.34 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
spreadsheet is a C++ library that enables "spreadsheet-programming", i.e., setting up variables ('cells') where each cell is assigned an expression that can contain the values of other cells. Changes are propagated to all dependent cells, as in a spreadsheet.
You create a new cell as follows:
Cell<double> a = sheet.NewCell<double>("a");
And you assign an expression to a cell as follows:
Cell<double> a = sheet.NewCell<double>("a");
Cell<double> b = sheet.NewCell<double>("b");
a.Set( SQRT(2 * b()) );
b.Set(18.3);
You get the current value of a cell with:
a.Value()
See main.cpp for a complete program with a simple usage example.
Spreadsheet was developed to demonstrate the use of streamulus. There are currently a few limitations, which will be removed if there is interest in this library for its own sake:
* Cyclic dependencies are not detected. You will be rewarded with the infinite loop you deserve.
* Note that in the code above, we needed to write "b()" in the expression assigned to a, rather than just "b". This is unfortunate, and with some proto-trickery can be fixed.
See also:
Blog post at http://streamulus.blogspot.co.uk/2012/08/spreadsheet-programming-in-c.html
Building:
spreadsheet is a header-only library. It uses boost and streamulus. So put these three libraries in your include path. That's all.