main
Download
40 lines 812 BGroffModified 2026-03-09 raw
12345678910111213141516171819202122232425262728293031323334353637383940
'\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH Table.with_fallback 3 2026-03-08 "Tomo man-pages"
.SH NAME
Table.with_fallback \- return a table with a new fallback
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Table.with_fallback\ :\ func(t:\ {K:V},\ fallback:\ {K:V}?\ ->\ {K:V})
.fi
.SH DESCRIPTION
Return a copy of a table with a different fallback table.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx
l l l.
Name	Type	Description
t	{K:V}	The table whose fallback will be replaced. 
fallback	{K:V}?	The new fallback table value. 
.TE
.SH RETURN
The original table with a different fallback.

.SH EXAMPLES
.EX
t := {"A": 1; fallback={"B": 2}}
t2 := t.with_fallback({"B": 3})
assert t2["B"] == 3
t3 := t.with_fallback(none)
assert t3["B"] == none
.EE
.SH SEE ALSO
.BR Tomo-Table (3)