Skip to content

Commit

Permalink
public function does not have return/returns
Browse files Browse the repository at this point in the history
  • Loading branch information
xhliu committed Mar 6, 2020
1 parent e452eaa commit 1dab2d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ They are only visible within the contract, similar to ``private`` functions in S

public function
---------------
A public function returns ``true`` if it runs to completion and ``false`` otherwise. Its ``returns`` and ``return`` parts are omitted.
In other words,
A public function returns ``true`` if it runs to completion and ``false`` otherwise.
It does not have ``returns`` and ``return`` parts, as they are included implicitly. In other words,

.. code-block:: solidity
public function sum(int a) returns (bool) {
public function sum(int a) {
require(a == 0);
return true;
}
is shortened to
is functionally equivalent to

.. code-block:: solidity
public function sum(int a) {
public function sum(int a) returns (bool) {
require(a == 0);
return true;
}
``return``
Expand Down

0 comments on commit 1dab2d4

Please sign in to comment.