10. Tabulation
Tabulation copies authored seeds into a fresh table, compares its length before every extension, invokes a compatible source-defined recurrence, and appends the returned integer atomically.
Complete Fibonacci program
The program accepts an integer named requested.
The program computes the following result.
Build a table from the sequence consisting of the difference of one and one using checked subtraction followed by one values in encounter order. Until its length reaches the requested length, extend it using Fibonacci continuation. Return the completed table.This historical source is not part of the current callable-Go compiler subset, so this page does not present generated code for it.
The verified result is [0,1,1,2,3,5,8,13]. The release spelling uses context ID length and has a published exact budget of 189; this project variant uses requested and is verified independently.
The current example gallery focuses on the callable-Go subset emitted by stated. Historical tabulation material is retained here as background, but it is not part of the current compiler example set.
Exercise
Run Fibonacci with requested length 2.
Verified solution
The two seeds already meet the requested length, so the verified result is [0,1] and no recurrence activation occurs.