Created
July 18, 2009 23:37
-
-
Save ngerakines/149735 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
$ erlc nick.erl && erlc vanessa.erl | |
1> Me = nick:new("Mountain View", "CA"). | |
{nick,"Mountain View","CA"} | |
2> Me:city(). | |
nick:city/0 -> "Mountain View" | |
ok | |
3> Me:state(). | |
nick:state/0 -> "CA" | |
ok | |
4> Vanessa = vanessa:new("Mountain View", "CA"). | |
{vanessa,{nick,"Mountain View","CA"},"Mountain View","CA"} | |
5> Vanessa:city(). | |
child:city/0 -> "Mountain View" | |
ok | |
6> Vanessa:state(). | |
nick:state/0 -> "CA" | |
ok | |
7> |
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
-module(nick, [City, State]). | |
-export([city/0, state/0]). | |
state() -> | |
io:format("nick:state/0 -> ~p~n", [State]). | |
city() -> | |
io:format("nick:city/0 -> ~p ~n", [City]). |
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
-module(vanessa, [City, State]). | |
-extends(nick). | |
-export([city/0]). | |
city() -> | |
io:format("child:city/0 -> ~p ~n", [City]). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment