Skip to content
Prev 51337 / 63424 Next

How do I reliably and efficiently hash a function?

Thanks. I know about `local` (and functions within functions). In
fact, the functions are *already* defined inside their own environment
(same as what `local` does). But unfortunately this doesn?t solve my
problem, since the functions? parent environment gets changed during
the function?s execution, and I need to retrieve my stored data
*after* that point, inside the function.

I?ve tried to create a more exact example of what?s going on ?
unfortunately it?s really hard to simplify the problem without losing
crucial details. Since the code is just a tad too long, I?ve posted it
as a Github Gist:

https://gist.github.com/klmr/53c9400e832d7fd9ea5c

The function `f` in the example calls `get_meta()` twice, and gets
different results before and after calling an ancillary function that
modifies the function?s `parent.env`. I want it to return the same
information (?original?) both times.

On Fri, Dec 11, 2015 at 10:49 AM, Mark van der Loo
<mark.vanderloo at gmail.com> wrote: