Lines Matching refs:it

122         croak("You can't use $package for LIST_CACHE because it can only store scalars");
135 # options. But if you did, it does do something reasonable: They
170 # This function tries to load a tied hash class and tie the hash to it.
186 croak("You can't use $module for LIST_CACHE because it can only store scalars");
262 # so we have a scalar value cached, so just return it straightaway:
283 croak "Could not unmemoize function `$f', because it was not memoized to begin with";
367 slow_function(arguments); # Is faster than it was before
391 `Memoizing' a function makes it faster by trading space for time. It
407 This function is very slow. Why? To compute fib(14), it first wants
409 fib(13), it first has to compute fib(12) and fib(11), and then it
411 is the same. And both of the times that it wants to compute fib(12),
412 it has to compute fib(11) from scratch, and then it has to do it
413 again each time it wants to compute fib(13). This function does so
414 much recomputing of old results that it takes a really long time to
416 and recompute things that it already computed.
419 `fib' function above, it will compute fib(14) exactly once, the first
420 time it needs to, and then save the result in a table. Then if you
421 ask for fib(14) again, it gives you the result out of the table.
422 While computing fib(14), instead of computing fib(12) twice, it does
423 it once; the second time it needs the value it gets it from the table.
424 It doesn't compute fib(11) four times; it computes it once, getting it
426 recursive calls to `fib', it makes 15. This makes the function about
449 This makes it easy to turn memoizing on and off.
452 program would look in a certain direction, figure out what it was
478 a reference to it. C<memoize> returns a reference to the new,
490 the way it behaves a little. To supply options, invoke C<memoize>
511 C<INSTALL> option it would have replaced the old C<fib> with the
541 it will not know that, and it will compute the values for these
568 the same for two argument lists, then it can safely look up the value
569 that it computed for one argument list and return it as the result of
576 and also when the arguments never contain character 28. However, it
596 even though it contains the same data. If this happens, C<Memoize>
620 3:45 PM it generates the 15th line instead. By default, C<Memoize>
628 function will treat its arguments differently in list context than it
656 or else it must be a reference to a list whose first element is one of
671 it any behavior you want.
675 retrieved from it again when needed, and the disk file typically
687 program has exited. Next time the program runs, it will find the
697 aid in the debugging of old programs that use it. Old programs should
713 (or list) context, and that if C<Memoize> detects such a call, it
727 but it probably does something useful.
741 the real C<pi> function; it gets the value from the scalar cache.
791 memoized function, and undoes whatever it did to provide the memoized
796 If you ask it to unmemoize a function that was never memoized, it
834 concerned, it always returns the same result. C<Memoize> is wrong, of
836 to get the current time, and it will return that same time
837 every time you call it after that.
850 Its return value is the numuber of characters it printed, but you
853 expect the first time you ask it to print the sum of 2 and 3, but
880 If you memoize C<getusers> here, it will work right exactly once. The
883 time you invoke C<main>, C<Memoize> will not call C<getusers>; it will
884 just return the same reference to the same list it got last time. But
886 erroneously remove another element from it. The list will get shorter
923 to, as long as it supports C<TIEHASH>, C<FETCH>, C<STORE>, and
942 C<Storable> isn't a tied hash class at all. You can use it to store a
943 hash to disk and retrieve it again, but you can't modify the hash while
944 it's on the disk. So if you want to store your cache table in a
967 that Memoize::Expire implements, it is easy to write your own plug-in
978 in Perl, and until it is resolved, memoized functions will see a
1020 This library is free software; you may redistribute it and/or modify
1021 it under the same terms as Perl itself.