Simple Summary
Vyper should not use required keyword arguments in built-in functions.
raw_call requires outsize and gas as keyword args.
slice requires start and len as keyword args.
Motivation
Given the similarity to between Vyper syntax and Python syntax, the current style is unintuitive to write and misleading to read. I believe keyword arguments should only be used for optional fields. All required arguments should always be positional.
Specification
- For
raw_call, convert outsize and gas to positional arguments.
a. Alternatively, gas could become an optional argument that defaults to gasLeft.
- For
slice, convert start and len to positional arguments.
# current
raw_call(_addr, b"moose", outsize=7, gas=50000)
slice(inp1, start=3, len=3)
# proposed
raw_call(_addr, b"moose", 7, 50000)
slice(inp1, 3, 3)
Backwards Compatibility
This is a breaking change, but it will only require slight modifications to existing contracts.
Copyright
Copyright and related rights waived via CC0
Simple Summary
Vyper should not use required keyword arguments in built-in functions.
raw_callrequiresoutsizeandgasas keyword args.slicerequiresstartandlenas keyword args.Motivation
Given the similarity to between Vyper syntax and Python syntax, the current style is unintuitive to write and misleading to read. I believe keyword arguments should only be used for optional fields. All required arguments should always be positional.
Specification
raw_call, convertoutsizeandgasto positional arguments.a. Alternatively,
gascould become an optional argument that defaults togasLeft.slice, convertstartandlento positional arguments.Backwards Compatibility
This is a breaking change, but it will only require slight modifications to existing contracts.
Copyright
Copyright and related rights waived via CC0