[Omake] Memoizing functions.
Aleksey Nogin
anogin at hrl.com
Thu Jun 28 13:57:32 PDT 2007
Jason,
What's your current thoughts on adding memoizing functions?
I was about to start adding dependencies to all the .STATIC sections in
the 0.9.8.x branch, but I realized that it is the wrong way to go, as:
- I would have added a PATH dependency to all the .STATIC blocks using
the CheckProg function
- I would have added a CC and CFLAGS dependency to all the .STATIC
blocks using the TryCompileC and its derivatives (CheckHeader, CheckLib,
etc).
It seems wrong that the user of a function would need to know and
specify every single time all the dependencies of a that function. It
would be a lot more natural, if the dependencies would be tracked by the
function itself, not by its users.
So I would like to reiterate my plea for decoupling the laziness and
memoization - the users of "expensive" functions should use the
appropriate lazy constructs, but it's the functions themselves that
should take care of memoization.
See also http://bugzilla.metaprl.org/show_bug.cgi?id=650 . One of the
solutions proposed there (by Jason) is to allow .STATIC sections inside
functions - something not currently supported.
Aleksey
--
Aleksey Nogin, Research Scientist
Advanced Technologies Department, Information & System Sciences Lab
HRL Laboratories, LLC, Malibu, CA
More information about the OMake-Devel
mailing list