Last active
April 6, 2020 21:15
-
-
Save ezequieloliveiralima/974d12ac151c8082bcae6e9c1ecb58e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Cachorro { | |
var nome: String | |
var raca: String | |
} | |
struct Pessoa { | |
var nome: String | |
var cachorros: [Cachorro] | |
} | |
func pessoa(pessoa: Pessoa, tem cachorro: Cachorro) -> Pessoa { | |
return Pessoa(nome: pessoa.nome, cachorros: pessoa.cachorros + [cachorro]) | |
} | |
func latir(cachorro: Cachorro) { | |
print("\(cachorro.nome) latiu!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment