Skip to content

@ngerakines /nick.erl
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
$ 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>
-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]).
-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
Something went wrong with that request. Please try again.