1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-14 10:45:06 +02:00

Is a little confusing naming the variable as the abstract. At first I was thinking that cat::Lion means that you are waiting for a Lion type of super type Cat

This commit is contained in:
Adrian Lopez
2013-12-16 23:33:41 +01:00
parent 6f194db755
commit d297853c06

View File

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