diff options
-rw-r--r-- | c++.html.markdown | 2 | ||||
-rw-r--r-- | perl6.html.markdown | 2 | ||||
-rw-r--r-- | ruby.html.markdown | 6 |
3 files changed, 4 insertions, 6 deletions
diff --git a/c++.html.markdown b/c++.html.markdown index a0f06c84..23013410 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -8,7 +8,6 @@ contributors: - ["Connor Waters", "http://github.com/connorwaters"] - ["Ankush Goyal", "http://github.com/ankushg07"] - ["Jatin Dhankhar", "https://github.com/jatindhankhar"] - --- C++ is a systems programming language that, @@ -474,6 +473,7 @@ int main() { // without a public or protected method for doing so class OwnedDog : public Dog { +public: void setOwner(const std::string& dogsOwner); // Override the behavior of the print function for all OwnedDogs. See diff --git a/perl6.html.markdown b/perl6.html.markdown index 18326338..364711af 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -1763,5 +1763,3 @@ If you want to go further, you can: - Come along on `#perl6` at `irc.freenode.net`. The folks here are always helpful. - Check the [source of Perl 6's functions and classes](https://github.com/rakudo/rakudo/tree/nom/src/core). Rakudo is mainly written in Perl 6 (with a lot of NQP, "Not Quite Perl", a Perl 6 subset easier to implement and optimize). - Read [the language design documents](http://design.perl6.org). They explain P6 from an implementor point-of-view, but it's still very interesting. - - [//]: # ( vim: set filetype=perl softtabstop=2 shiftwidth=2 expandtab cc=80 : ) diff --git a/ruby.html.markdown b/ruby.html.markdown index a1532855..e0a6bb6e 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -359,13 +359,13 @@ ensure puts 'This code always runs no matter what' end -# Functions +# Methods def double(x) x * 2 end -# Functions (and all blocks) implicitly return the value of the last statement +# Methods (and all blocks) implicitly return the value of the last statement double(2) #=> 4 # Parentheses are optional where the result is unambiguous @@ -399,7 +399,7 @@ surround { puts 'hello world' } # } -# You can pass a block to a function +# You can pass a block to a method # "&" marks a reference to a passed block def guests(&block) block.call 'some_argument' |