To try out code updating, do the following.

- Compile all the files (e.g., do erlc *.erl).
- Start the erlang shell (i.e., run "erl")
- Issue the following commands:

server_dsu:start(name_server,name_server1).
name_server1:add(mike,"in class"). % returns ok
name_server1:whereis(mike).   % returns {ok,"in class"}
server_dsu:swap_code(name_server,new_name_server).
new_name_server:all_names().  % returns [mike]

In short: we start the server, having it run our name_server1
implementation of the name server.  Then we add a mapping to the
server, and update it to the new version.  This new version implements
some new functions, in particular, a function that returns all the
names that have been mapped.  When called, this function returns the
current state of the server.

Questions:

- What is returned in the following transcript:

server_dsu:start(name_server,name_server1).
name_server1:add(mike,"in class").
name_server1:whereis(mike).
new_name_server:all_names().  % what is returned?

- How about this one:

server_dsu:start(name_server,name_server1).
name_server1:add(mike,"in class").
name_server1:whereis(mike).
unregister(name_server).
server_dsu:start(name_server,new_name_server).
new_name_server:all_names().  % what is returned?

Make sure you know why (after you run them and see if your answers are
right) in each case.