(43 lines)
1 '\" t2 .\" Copyright (c) 2025 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Table.get 3 2025-11-29 "Tomo man-pages"6 .SH NAME7 Table.get \- get an item from a table8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Table.get\ :\ func(t:\ {K:V},\ key:\ K\ ->\ V?)13 .fi14 .SH DESCRIPTION15 Retrieves the value associated with a key, or returns `none` if the key is not present.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx23 l l l.24 Name Type Description25 t {K:V} The table.26 key K The key whose associated value is to be retrieved.27 .TE28 .SH RETURN29 The value associated with the key or `none` if the key is not found.31 .SH NOTES32 Default values for the table are ignored.34 .SH EXAMPLES35 .EX36 t := {"A": 1, "B": 2}37 assert t.get("A") == 138 assert t.get("????") == none39 assert t.get("A")! == 140 assert t.get("????") or 0 == 041 .EE42 .SH SEE ALSO43 .BR Tomo-Table (3)