What is an .hrl
file in Erlang/OTP? Is it some sort of library mechanism?
Asked
Active
Viewed 1.2k times
26
-
3After reading the link you showed maybe me and you should "agree to disagree" on what the definition of "readability" is. But thanks for the link anyway :) – yazz.com Feb 23 '10 at 08:39
-
@dustin: i stumbled over them in "programming erlang" on page 60. so -- there is indeed the possibility to know of the existence without knowing the purpose or contents. – aurora Aug 14 '11 at 17:08
3 Answers
37
A "header file" akin to a "C" include file.
One needs to invoke the -include
directive from an .erl
file to use them. Can contain any valid Erlang code.
-
1You can also use `-include_lib` to include a header file from another application. – Zed Feb 22 '10 at 16:48
-
1@zed: yes, see the following SO question: http://stackoverflow.com/questions/1847918/erlang-what-is-the-difference-between-include-lib-and-include – jldupont Feb 22 '10 at 17:08
7
hrl files are simply erlang "header", that is files containing common definitions that are intended to be included by .erl files.

tonio
- 10,355
- 2
- 46
- 60