mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Add NEWS entries for lambda/capture-list functionality
This commit is contained in:
parent
0a7e5e67a2
commit
c166288248
2 changed files with 14 additions and 0 deletions
13
NEWS
13
NEWS
|
@ -9,6 +9,12 @@ Zeek 4.1.0
|
||||||
New Functionality
|
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
|
Changed Functionality
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
@ -21,6 +27,13 @@ Removed Functionality
|
||||||
Deprecated 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
|
Zeek 4.0.0
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
|
|
@ -4429,6 +4429,7 @@ void LambdaExpr::CheckCaptures()
|
||||||
{
|
{
|
||||||
if ( outer_ids.size() > 0 )
|
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",
|
reporter->Warning("use of outer identifiers in lambdas without [] captures is deprecated: %s%s",
|
||||||
outer_ids.size() > 1 ? "e.g., " : "",
|
outer_ids.size() > 1 ? "e.g., " : "",
|
||||||
outer_ids[0]->Name());
|
outer_ids[0]->Name());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue