Billy Naylor asked:

Would it be useful to apply memoization in a similar fashion...

  sub square ( Num $n ) is memo {
	return $n ** $n;
  }
Yes. Larry indicated this in A2
(see http://search.cpan.org/perl6/apo/A02.pod#Properties).

The name of the property is still under debate. Larry favours:

	sub square ( Num $n ) is same {...}

whereas others feel that:

	sub square ( Num $n ) is memoized {...}

is more appropriate.

Damian

Reply via email to