Add an API for lambda expressions [blocks: #4651]#4672
Add an API for lambda expressions [blocks: #4651]#4672tautschnig merged 3 commits intodiffblue:developfrom
Conversation
We have support for ID_lambda expressions in some places, but did not yet have a proper API for them.
The API increases the readability of the code and also enables early checking for valid expression structure.
Replacing the lambda parameter by the argument value may permit further simplification, for example in case of constant arguments.
allredj
left a comment
There was a problem hiding this comment.
This PR failed Diffblue compatibility checks (cbmc commit: 548e8e2).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112369892
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
|
@tautschnig This change is causing problems in TG, and it took me a while to understand it because I was thinking about lambdas in general (= any kind of anonymous function) and didn't understand why the documentation and constructor were about array types only. @smowton explained to me that these "lambda_exprts" aren't general lambdas, but they are used for the specific case of defining an array using a kind of list comprehension. I think it would be clearer to name them |
This is factored out from/in preparation of #4651, which will eventually also add testing for this code.