Add NEWS entries for lambda/capture-list functionality

This commit is contained in:
Jon Siwek 2021-01-11 16:29:39 -08:00
parent 0a7e5e67a2
commit c166288248
2 changed files with 14 additions and 0 deletions

13
NEWS
View file

@ -9,6 +9,12 @@ Zeek 4.1.0
New Functionality
-----------------
- Lambda functions can now use capture-list to help specify exactly which local
variables from outer scopes need to made available while evaluating the lambda
and also the method by which they're made available: deep vs. shallow copy.
For examples, see: https://docs.zeek.org/en/master/script-reference/types.html#type-function
Changed Functionality
---------------------
@ -21,6 +27,13 @@ Removed Functionality
Deprecated Functionality
------------------------
- Lambda/closure support: automatic capturing of references to variables
outside a lambda's scope is now deprecated. An explicit capture
list which also specifies the desired copy-semantics is now required when
writing lambda functions that refer to local variables of an outer scope.
For examples, see: https://docs.zeek.org/en/master/script-reference/types.html#type-function
Zeek 4.0.0
==========

View file

@ -4429,6 +4429,7 @@ void LambdaExpr::CheckCaptures()
{
if ( outer_ids.size() > 0 )
{
// TODO: Remove in v5.1: these deprecated closure semantics
reporter->Warning("use of outer identifiers in lambdas without [] captures is deprecated: %s%s",
outer_ids.size() > 1 ? "e.g., " : "",
outer_ids[0]->Name());