Recursion is one aspect of the advanced, artifical intelligence based concepts within Freedombase, that allows Freedombase to apply most business logic without requiring custom code to be written.
Because Recursion within Freedombase is an advanced concept, it may be useful for you to initially skip the recursion tutorials - starting with the bulk of this page - that cover recursion. Once you feel confident that you understand Freedombase otherwise, you can then return to these three Recursion pages in order to understand the detail.
If you do choose to skip the three Recursion pages, including this one, for now, just remember to set the value '1' within any Recurse fields that you see within Freedombase. This is usually the most useful setting. Later on, when you feel more comfortable with Freedombase, feel free to come back and read through the Recursion tutorial pages. At that time you may wish to change some of the Recurse values that you set to '1' previously.
You may recall that we set Recurse to 1 for all Calculations, as we entered them. This is not necessary, but it can provide performance advantages, so it is a good idea. It provides performance advantages, because calculations are inherently recursive; every recursion requires processing time; so setting the recursion to 1 except for when another setting is specifically required, may improve performance.
Admittedly, unless you create a very complex calculation, with multiple levels of recursion, setting Recurse to 1 will make no noticeable difference on individual trnasactions; however, it is a good habit to get into, and will probably make the software more efficient when dealing with large numbers of transactions.
The result of one calculation, may be another calculation; and the result of that calculation may be another calculation, etc, etc, etc. To handle this, Freedombase will evaluate the calculation; it will then evaluate the result of the calculation; and then evaluate the result of that calculation; until either the result stops changing - meaning the result is a literal, not a calculation; or until the maximum Recurse has been reached. By setting Recurse to 1, we guarantee that Freedombase will stop evaluating after the first iteration; that is, Freedombase will evaluate the calculation, and then stop, it will not evaluate the result of the calculation.
Please note that if Recurse is not manually set, Freedombase will apply a default maximum recurse of 99. This default can be overridden by setting values in the Control class.
There are three different kinds of recursion within Freedombase; Class, Result, and Internal.
| previous | next |
| 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 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |

