[erlang-questions] How to include lib in erl interpreter?

Erik Søe Sørensen eriksoe@REDACTED
Wed May 29 07:17:03 CEST 2013


You can do that - and that would give access to any exported functions
defined by the header file.
But not to macros or record definitions, as they are not present in the
compiled module.
Den 29/05/2013 04.06 skrev "苏晔俊" <goofan.su@REDACTED>:

> According to http://www.erlang.org/doc/man/shell.html:
>
> *If a command (local function call) is not recognized by the shell, an
> attempt is first made to find the function in the module user_default,
> where customized local commands can be placed. If found, then the function
> is evaluated. Otherwise, an attempt is made to evaluate the function in the
> module shell_default. The module user_default must be explicitly loaded.*
> *
> *
> So you can place a "user_default.erl" file in your project, and place "
> -include_lib("../.hrl")." in the file.
>
>
> 2013/5/29 Erik Søe Sørensen <eriksoe@REDACTED>
>
>> Include for what purpose, exactly?
>> Record definitions can be read into the shell using (I think) the "rr"
>> command - cf. the command list provided by "help().".
>> If it is macros you wish to use, however, I don't think the shell
>> supports that.
>> (Include files may contain other definitions than these two kinds, of
>> course, but it would surprise me a bit if it's something else you need...)
>> Den 29/05/2013 00.34 skrev "Andrew Pennebaker" <
>> andrew.pennebaker@REDACTED>:
>>
>>>  In a compiled Erlang program, we use -include_lib("../.hrl"). How can
>>> we include libraries in an active erl interpreter session?
>>>
>>> --
>>> Cheers,
>>>
>>> Andrew Pennebaker
>>> www.yellosoft.us
>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130529/675d591c/attachment.htm>


More information about the erlang-questions mailing list