/ find the present value of a payment of amt that you receive numyears out / assuming an interest of interest. presval:{[interest; numyears; amt] :amt % ((1 + (interest % 100)) xexp numyears) } / parse the command line arguments to have two lists, one for the amounts / and other for the yields processargs:{[list] i: list ? "_"; amounts: "F"$list[til i]; yields: "F"$(i+1) _ list; out: 0; i: 0; while[i < count amounts; out+: presval[yields[i]; i+1; amounts[i]]; i+: 1; ]; :out } processargs .z.x