Janet 1.14.1-49dcc81 Documentation
(Other Versions: 1.13.1 1.12.2 1.11.1 1.10.1 1.9.1 1.8.1 1.7.0 1.6.0 1.5.1 1.5.0 1.4.0 1.3.1 )

Table Module

Index

table/clone table/getproto table/new table/rawget table/setproto table/to-struct


table/clone cfunction
(table/clone tab)

Create a copy of a table. Updates to the new table will not change the old table, and vice versa.
Community Examples

table/getproto cfunction
(table/getproto tab)

Get the prototype table of a table. Returns nil if a table has no prototype, otherwise returns the prototype.
Community Examples

table/new cfunction
(table/new capacity)

Creates a new empty table with pre-allocated memory for capacity entries. This means that if one knows the number of entries going to go in a table on creation, extra memory allocation can be avoided. Returns the new table.
Community Examples

table/rawget cfunction
(table/rawget tab key)

Gets a value from a table without looking at the prototype table. If a table tab does not contain t directly, the function will return nil without checking the prototype. Returns the value in the table.
Community Examples

table/setproto cfunction
(table/setproto tab proto)

Set the prototype of a table. Returns the original table tab.
Community Examples

table/to-struct cfunction
(table/to-struct tab)

Convert a table to a struct. Returns a new struct. This function does not take into account prototype tables.
Community Examples