[Omake] Memoizing functions.
Jason Hickey
jyh at cs.caltech.edu
Thu Jun 28 15:12:34 PDT 2007
I should try to understand this better.
I agree that memoization is a separate useful concept. Do you mean
that .STATIC should also be changed?
For memoization, we could do the following.
$(memo <fun>)
is the same as <fun>, except it is memoized, and can only be used
with arguments that can be compared in the normal way.
But this seems separate from .STATIC. BTW, (it should be documented
that) .STATIC allows a :key: option.
f(x) =
.STATIC: :key: $x
y = $(g $x)
value $y
However, it looks like this is broken, and should be fixed.
Jason
On Jun 28, 2007, at 1:57 PM, Aleksey Nogin wrote:
> 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
> _______________________________________________
> OMake-Devel mailing list
> OMake-Devel at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake-devel
--
Jason Hickey http://www.cs.caltech.edu/~jyh
Caltech Computer Science Tel: 626-395-6568 FAX: 626-792-4257
More information about the OMake-Devel
mailing list