[erlang-bugs] odd rr behaivor

Matthew O'Gorman <>
Fri Sep 28 19:52:35 CEST 2007


I wouldn't necessarily call this a bug, but it seems rr does not allow
for passing an atom to it in the same way, for example

1> ls().
mog.hrl
ok
2> rr(mog).
{error, nofile}
3>rr("mog").
[]
4>rr("mog.hrl").
[test]


this seems quiet different than the way l and c work from the shell,
and might scare off new comers, not to mention examples show it work
another way.
also it seems odd that rr isnt included in c module but in the shell
module, i realize that this is probably a design decisions so that
records are loaded locally to the shell.  I was able to fix it
partially on my own box by adding a clause at line 819 or so in the
shell.erl file

local_func(rr, [{atom, _, A1}], Bs0, _Shell, RT, Lf, Ef) ->
    A = {string, 1, atom_to_list(A1)},
    {[File],Bs} = expr_list([A], Bs0, Lf, Ef),
    {value,read_and_add_records(File, '_', [], Bs, RT),Bs};

however i imagine this is wrong, and also leads to having to call
rr('mog.hrl').  so its not very helpful, as it still is not the same
as the other tools.



More information about the erlang-bugs mailing list