有没有办法直接在erl中使用记录?不管我怎么尝试,它总是说找不到记录。我正在尝试进行 mnesia 交易,如果没有我的记录,我就无法走得太远。非常感谢任何帮助 - 谢谢!
最佳答案
是的,使用 help() 并在 shell 中找到这些命令。
rd(R,D) -- define a record
rf() -- remove all record information
rf(R) -- remove record information about R
rl() -- display all record information
rl(R) -- display record information about R
rp(Term) -- display Term using the shell's record information
rr(File) -- read record information from File (wildcards allowed)
rr(F,R) -- read selected record information from file(s)
rr(F,R,O) -- read selected record information with options
这些是 shell 中的一个巧妙的 hack,它们允许您在编译模块时加载模块中使用的记录定义。使用 rr 命令从模块加载它。
请记住,这些仅可供交互式 shell 使用。
关于erlang - Erl 中的记录(Erlang 问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1386211/