There's also some weirdness with the current implementation:

Urp. Yeah, things get wonky in the current implementation when the original outer function exits. (Your example works as expected if we move the `zeek_init` statements into `demo`.) There’s a bunch of code in that case to salvage access to the now-otherwise-reclaimed frame, and it’s more complicated than one would like because of the need to avoid pointer cycles that will lead to leaks. No doubt it’s duplicating the frame at that point, rather than arranging to still share it.

If lambdas had their scope limited to the outer function, it all gets so much easier … but also then doesn’t address some basic use cases.

— Vern
_______________________________________________
zeek-dev mailing list -- zeek-dev@lists.zeek.org
To unsubscribe send an email to zeek-dev-le...@lists.zeek.org

Reply via email to