Skip to content

Commit

Permalink
Correct spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
Denton-L committed Aug 25, 2016
1 parent c276086 commit f5989fb
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions docs/contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,18 @@ storage and is not able to call ``f``. Contract ``E`` is derived from ``C`` and

contract D {
function readData() {
C c = new C();
local = c.f(7); // error: member "f" is not visible
c.setData(3);
uint local = c.getData();
local = c.compute(3,5); // error: member "compute" is not visible
}
C c = new C();
local = c.f(7); // error: member "f" is not visible
c.setData(3);
uint local = c.getData();
local = c.compute(3,5); // error: member "compute" is not visible
}
}

contract E is C {
function g() {
C c = new C();
uint val = compute(3,5); // acces to internal member (from derivated to parent contract)
C c = new C();
uint val = compute(3,5); // acces to internal member (from derivated to parent contract)
}
}

Expand All @@ -244,12 +244,12 @@ be done at declaration.
contract C {
uint public data = 42;
}

contract Caller {
C c = new C();
function f() {
uint local = c.data();
}
C c = new C();
function f() {
uint local = c.data();
}
}

The accessor functions have external visibility. If the
Expand All @@ -260,11 +260,11 @@ it is evaluated as state variable and if it is accessed externally
::

contract C {
uint public data;
function x() {
data = 3; // internal access
uint val = this.data(); // external access
}
uint public data;
function x() {
data = 3; // internal access
uint val = this.data(); // external access
}
}

The next example is a bit more complex:
Expand Down

0 comments on commit f5989fb

Please sign in to comment.