Janet 1.43.0-e4b5045 Documentation
(Other Versions: 1.42.0 1.41.2 1.41.1 1.40.1 1.40.0 1.39.1 1.38.0 1.37.1 1.36.0 1.35.0 1.34.0 1.31.0 1.29.1 1.28.0 1.27.0 1.26.0 1.25.1 1.24.0 1.23.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.1 1.17.1 1.16.1 1.15.0 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 )

Tuple Module

Index

tuple/brackets tuple/join tuple/setmap tuple/slice tuple/sourcemap tuple/type


tuple/brackets cfunction source
(tuple/brackets & xs)

Creates a new bracketed tuple containing the elements xs.
Community Examples

tuple/join cfunction source
(tuple/join & parts)

Create a tuple by joining together other tuples and arrays.
Community Examples

tuple/setmap cfunction source
(tuple/setmap tup line col)

Set the sourcemap metadata on a tuple, `tup`. `line` and `col` should be integers.
Community Examples

tuple/slice cfunction source
(tuple/slice ind &opt start end)

Returns a tuple based on a range of an indexed type `ind`. The range is specified by optional index arguments `start` and `end` defaulting to 0 and the length of `ind` respectively. When non-negative, `start` is inclusive and `end` is exclusive, i.e. [`start`, `end`), and their values can range from 0 through the length of `ind`. When negative, `start` is exclusive and `end` is inclusive, i.e. (`start`, `end`], and their values can range from the negative of one more than the length of `ind` through -1. If `start` or `end` is out of range, an error is raised.
Community Examples

tuple/sourcemap cfunction source
(tuple/sourcemap tup)

Returns the sourcemap metadata attached to a tuple `tup`, which is another tuple `[line column]`.
Community Examples

tuple/type cfunction source
(tuple/type tup)

Checks how the tuple was constructed. Will return the keyword :brackets if the tuple was parsed with brackets, and :parens otherwise. The two types of tuples will behave the same most of the time, but will print differently and be treated differently by the compiler.
Community Examples