Do not require parentheses on function return values

This commit is contained in:
Alex Beregszaszi 2017-04-21 16:53:20 +01:00
parent ad5cd21571
commit 29da069bf0

View File

@ -30,7 +30,7 @@ and ``mod`` are available either natively or as functions and computes exponenti
.. code:: .. code::
{ {
function power(base:u256, exponent:u256) -> (result:u256) function power(base:u256, exponent:u256) -> result:u256
{ {
switch exponent switch exponent
case 0:u256: { result := 1:u256 } case 0:u256: { result := 1:u256 }
@ -51,7 +51,7 @@ and ``add`` to be available.
.. code:: .. code::
{ {
function power(base:u256, exponent:u256) -> (result:u256) function power(base:u256, exponent:u256) -> result:u256
{ {
result := 1:u256 result := 1:u256
for { let i := 0:u256 } lt(i, exponent) { i := add(i, 1:u256) } for { let i := 0:u256 } lt(i, exponent) { i := add(i, 1:u256) }
@ -79,7 +79,7 @@ Grammar::
SubAssembly SubAssembly
FunctionDefinition = FunctionDefinition =
'function' Identifier '(' IdentifierList? ')' 'function' Identifier '(' IdentifierList? ')'
( '->' '(' IdentifierList ')' )? Block ( '->' IdentifierList )? Block
VariableDeclaration = VariableDeclaration =
'let' IdentifierOrList ( ':=' Expression )? 'let' IdentifierOrList ( ':=' Expression )?
Assignment = Assignment =
@ -250,10 +250,10 @@ JULIA has no support for implicit type conversion and therefore functions exists
When converting a larger type to a shorter type a runtime exception can occur in case of an overflow. When converting a larger type to a shorter type a runtime exception can occur in case of an overflow.
The following type conversion functions must be available: The following type conversion functions must be available:
- ``u32tobool(x:u32) -> (y:bool)`` - ``u32tobool(x:u32) -> y:bool``
- ``booltou32(x:bool) -> (y:u32)`` - ``booltou32(x:bool) -> y:u32``
- ``u32tou64(x:u32) -> (y:u64)`` - ``u32tou64(x:u32) -> y:u64``
- ``u64tou32(x:u64) -> (y:u32)`` - ``u64tou32(x:u64) -> y:u32``
- etc. (TBD) - etc. (TBD)
Low-level Functions Low-level Functions