Merge pull request #454 from adrianlzt/feature/improve_defined_types_functions

[julia/en] Functions with defined types parameters a little bit confusing
This commit is contained in:
Adam Bard 2013-12-20 10:34:48 -08:00
commit 0aa7e32f05

View File

@ -575,15 +575,15 @@ end
# For a non-constructor example, let's make a function meow:
# Definitions for Lion, Panther, Tiger
function meow(cat::Lion)
cat.roar # access type properties using dot notation
function meow(animal::Lion)
animal.roar # access type properties using dot notation
end
function meow(cat::Panther)
function meow(animal::Panther)
"grrr"
end
function meow(cat::Tiger)
function meow(animal::Tiger)
"rawwwr"
end