From 18539e53530c812790fbb396a5e5ca5806efb6ba Mon Sep 17 00:00:00 2001 From: Raghav Dua Date: Tue, 23 Jan 2018 23:23:18 +0530 Subject: Abstract Contracts: Add note about function type --- docs/contracts.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/contracts.rst b/docs/contracts.rst index 273ea43a..69d47fef 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -1053,6 +1053,19 @@ but they can be used as base contracts:: If a contract inherits from an abstract contract and does not implement all non-implemented functions by overriding, it will itself be abstract. +Note that an abstract function is different from a :ref:`Function Type ` even though their syntax looks very similar. + +Example of Abstract function (a function declaration) +:: + + function foo(address) external returns (address); + +Example of a Function Type (a variable declaration, where the variable is of type ``function``) +:: + + function(address) external returns (address) foo; + + .. index:: ! contract;interface, ! interface contract ********** -- cgit v1.2.3 From 694fc6835f600c124bdc538fe454056aea024dc8 Mon Sep 17 00:00:00 2001 From: Raghav Dua Date: Tue, 23 Jan 2018 23:43:04 +0530 Subject: correct terminology --- docs/contracts.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contracts.rst b/docs/contracts.rst index 69d47fef..a9b42f15 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -1053,9 +1053,9 @@ but they can be used as base contracts:: If a contract inherits from an abstract contract and does not implement all non-implemented functions by overriding, it will itself be abstract. -Note that an abstract function is different from a :ref:`Function Type ` even though their syntax looks very similar. +Note that a function without implementation is different from a :ref:`Function Type ` even though their syntax looks very similar. -Example of Abstract function (a function declaration) +Example of function without implementation (a function declaration) :: function foo(address) external returns (address); -- cgit v1.2.3 From 09887de266665c1233cd2aa853e8271e6af282db Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 19 Feb 2018 19:02:49 +0100 Subject: Fix link. --- docs/contracts.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/contracts.rst b/docs/contracts.rst index a9b42f15..d3978672 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -1053,15 +1053,13 @@ but they can be used as base contracts:: If a contract inherits from an abstract contract and does not implement all non-implemented functions by overriding, it will itself be abstract. -Note that a function without implementation is different from a :ref:`Function Type ` even though their syntax looks very similar. +Note that a function without implementation is different from a :ref:`Function Type ` even though their syntax looks very similar. -Example of function without implementation (a function declaration) -:: +Example of function without implementation (a function declaration):: function foo(address) external returns (address); -Example of a Function Type (a variable declaration, where the variable is of type ``function``) -:: +Example of a Function Type (a variable declaration, where the variable is of type ``function``):: function(address) external returns (address) foo; -- cgit v1.2.3