[Prev][Next][Index][Thread]

Re: Closures



Suppose that we change this part of the example
slightly to use a variable rather than the constant
100, is this correct?

begin
  let my-amount := 100
  let (my-balance, my-deposit, my-calc-interest)
    = make-account(my-amount, 3);
  my-deposit(50);
  my-calc-interest();
  values (my-balance(), my-amount);
end;

=> 154.5, 154.5

-- Doug



Follow-Ups: References: