mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update visibility and getters.
This commit is contained in:
parent
269c3c0c06
commit
9de0b3d7b5
@ -6,10 +6,10 @@
|
|||||||
Visibility and Getters
|
Visibility and Getters
|
||||||
**********************
|
**********************
|
||||||
|
|
||||||
Since Solidity knows two kinds of function calls (internal
|
Solidity knows two kinds of function calls: internal
|
||||||
ones that do not create an actual EVM call (also called
|
ones that do not create an actual EVM call (also called
|
||||||
a "message call") and external
|
a "message call") and external
|
||||||
ones that do), there are four types of visibilities for
|
ones that do. Because of that, there are four types of visibility for
|
||||||
functions and state variables.
|
functions and state variables.
|
||||||
|
|
||||||
Functions have to be specified as being ``external``,
|
Functions have to be specified as being ``external``,
|
||||||
@ -22,7 +22,8 @@ For state variables, ``external`` is not possible.
|
|||||||
via transactions. An external function ``f`` cannot be called
|
via transactions. An external function ``f`` cannot be called
|
||||||
internally (i.e. ``f()`` does not work, but ``this.f()`` works).
|
internally (i.e. ``f()`` does not work, but ``this.f()`` works).
|
||||||
External functions are sometimes more efficient when
|
External functions are sometimes more efficient when
|
||||||
they receive large arrays of data.
|
they receive large arrays of data, because the data
|
||||||
|
is not copied from calldata to memory.
|
||||||
|
|
||||||
``public``:
|
``public``:
|
||||||
Public functions are part of the contract interface
|
Public functions are part of the contract interface
|
||||||
|
Loading…
Reference in New Issue
Block a user