# An operator as a value (owner, 2026-09-29): `op +`, handed wherever a function goes. Its type# comes from where it goes. `op -` subtracts; negation is `op neg`. A custom operator's operands# are lent, so `op dot` is a fn[lent Vec, lent Vec] -> bin64.structVec{x:bin64,y:bin64}opdot['a':Vec,'b':Vec]->bin64{return'a'.xtimes'b'.xplus'a'.ytimes'b'.y;}fnfold[lent'xs':list[int32],'start':int32,'f':fn[int32,int32]->int32]->int32{letmut'acc':='start';for'x'inlend'xs'{change'acc'='f'['acc','x'];}return'acc';}fnapply1['v':int32,'f':fn[int32]->int32]->int32{return'f'['v'];}fntest2['a':int32,'b':int32,'f':fn[int32,int32]->bool]->bool{return'f'['a','b'];}fnboth[lent'a':Vec,lent'b':Vec,'f':fn[lentVec,lentVec]->bin64]->bin64{return'f'[lend'a',lend'b'];}MAIN{let'xs':list[int32]=[1,2,3,4];let'sum':=fold[lend'xs',0,opplus];let'product':=fold[lend'xs',1,optimes];let'down':=fold[lend'xs',0,opminus];let'n':=apply1[5,opneg];let'le':=test2[3,3,opat_most];let'f':fn[int32,int32]->int32=opmod.floor;let'm':='f'[-7,3];let'u':=Vec[x=1.0,y=2.0];let'v':=Vec[x=3.0,y=4.0];let'd':=both[lend'u',lend'v',opdot];std::print.useful['sum'," ",'product'," ",'down'," ",'n'," ",'le'," ",'m'," ",'d',newln];}