# Solidity Design Call Scratch Notes Weekly long-term light syntax brainstorming: lambda functions & higher-order functions as replacement for modifiers Note: look at python decorators ```solidity= contract C { // only legacy modifier onlyOwner() { require(...); _; ... } function f(uint256 x) onlyOwner public pure returns (uint256) { ... } // new language proposal function onlyOwner(auto f) returns (auto) { return [](auto x) -> auto r { require(...); r = f(x); ... } } function f = onlyOwner ([](uint256 x) -> uint256 { .... }); function f(uint256 y) -> (uint256 r) { } // lambda syntax (lambda x . x) (lambda x:T . { reutrn x; }) (% x . x) (% x . { reutrn x; }) (x:T -> x) (x:T -> r:R { return f(x); }) (x:T -> r:R { r = f(x); }) (x -> { return x; }) (x => { return x; }) (x:T -> r:R { return f(x); }) (x:T => x:R) (fn x => x) (function f(x) returns (y) { return g(y); }) 0; } ``` https://github.com/ethereum/solidity/pull/14177 https://github.com/ethereum/solidity/pull/14186