Mar 3, 2008
Generic-user-small Mike Lutz 1 post

Topic: Programming Erlang / code:get_path / code:add_path

code:getpath() returns a list of the current directories searched for modules. This list can be modified by code:add_patha() and code:add_pathz() and a bunch of their cousins. This looks like a violation of the one assignment rule – otherwise, how can code:get_path() return different values at different times?

The source code shows add_patha as:

add_patha(Dir) when is_list(Dir) -> call({add_path,first,Dir}).

and I can’t find any documentation on “call”, so my suspicion is that it’s some internal mumbo-jumbo in the interpreter, but I’d love to have this explained. A form of continuation??

MJL

1 post