Allow binary operators to be used as lambdas (#385)
* Add operator lambdas * Do not register anonymous functions as called functions * Add tests * Update CHANGELOG * Update the docs * Do not allow (..) to be used as a lambda * Rename the function sum to any
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
include "List.aes"
|
||||
|
||||
contract C =
|
||||
type state = int
|
||||
|
||||
function any(l : list(bool)) : bool = List.foldl((||), false, l)
|
||||
|
||||
entrypoint init() =
|
||||
let bad_application = (+)(1)
|
||||
let good_application = (-)(3, 4)
|
||||
let op_var = (+)
|
||||
let op_var_application = op_var(3, 4)
|
||||
|
||||
good_application + op_var_application
|
||||
Reference in New Issue
Block a user