Table creation: Difference between revisions

Content added Content deleted
(→‎{{header|Wren}}: Added a second version based on the new Wren-table module.)
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 1,156: Line 1,156:


In practice, a binary search would be needed to find records quickly by key given that the records are being maintained in sorted order. However, for now we use a sequential search instead.
In practice, a binary search would be needed to find records quickly by key given that the records are being maintained in sorted order. However, for now we use a sequential search instead.
<syntaxhighlight lang="ecmascript">import "./dynamic" for Enum, Tuple
<syntaxhighlight lang="wren">import "./dynamic" for Enum, Tuple
import "./fmt" for Fmt
import "./fmt" for Fmt
import "./sort" for Cmp, Sort
import "./sort" for Cmp, Sort
Line 1,305: Line 1,305:
{{libheader|Wren-table}}
{{libheader|Wren-table}}
The above module provides a more generic way to create simple databases and was not available when the first version was written.
The above module provides a more generic way to create simple databases and was not available when the first version was written.
<syntaxhighlight lang="ecmascript">import "./table" for FieldInfo, Table, Records
<syntaxhighlight lang="wren">import "./table" for FieldInfo, Table, Records


var fields = [
var fields = [