/** Pack the value into the box so that it is passed by reference */ export interface Box { val: T } /** Pack the value into the box so that it is passed by reference */ export function box(val: T): Box { return { val } } /** Take the value from the Box */ export function getVal(box: Box): T { return box.val } /** Set the value to Box */ export function setVal(box: Box, val: T): Box { box.val = val return box }