diff options
author | chriseth <chris@ethereum.org> | 2016-09-06 21:59:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-06 21:59:49 +0800 |
commit | 453490cb61002622fadddf5838d29a8483f364ae (patch) | |
tree | 2d5ff5cddbf8fd73afe75a516998b9890b6cf86e /docs/control-structures.rst | |
parent | 462fc84e530a6e740dfc8bb92bbd5ba82862cbb2 (diff) | |
parent | 183cd70c47e27f2cec34512757860193104f674b (diff) | |
download | dexon-solidity-453490cb61002622fadddf5838d29a8483f364ae.tar.gz dexon-solidity-453490cb61002622fadddf5838d29a8483f364ae.tar.zst dexon-solidity-453490cb61002622fadddf5838d29a8483f364ae.zip |
Merge pull request #1003 from winsvega/docs
add "pragma solidity ^0.4.0;" to code examples
Diffstat (limited to 'docs/control-structures.rst')
-rw-r--r-- | docs/control-structures.rst | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst index e6dfe4f6..61a8611e 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -98,6 +98,8 @@ parameters from the function declaration, but can be in arbitrary order. :: + pragma solidity ^0.4.0; + contract C { function f(uint key, uint value) { ... } @@ -115,6 +117,8 @@ Those names will still be present on the stack, but they are inaccessible. :: + pragma solidity ^0.4.0; + contract C { // omitted name for parameter function func(uint k, uint) returns(uint) { @@ -136,6 +140,8 @@ creation-dependencies are now possible. :: + pragma solidity ^0.4.0; + contract D { uint x; function D(uint a) { @@ -343,6 +349,8 @@ idea is that assembly libraries will be used to enhance the language in such way .. code:: + pragma solidity ^0.4.0; + library GetCode { function at(address _addr) returns (bytes o_code) { assembly { @@ -368,6 +376,8 @@ you really know what you are doing. .. code:: + pragma solidity ^0.4.0; + library VectorSum { // This function is less efficient because the optimizer currently fails to // remove the bounds checks in array access. @@ -623,6 +633,8 @@ It is planned that the stack height changes can be specified in inline assembly. .. code:: + pragma solidity ^0.4.0; + contract C { uint b; function f(uint x) returns (uint r) { @@ -697,6 +709,8 @@ be just ``0``, but it can also be a complex functional-style expression. .. code:: + pragma solidity ^0.4.0; + contract C { function f(uint x) returns (uint b) { assembly { |