[erlang-questions] macro in include definition - can't

Wes James <>
Wed May 11 16:06:02 CEST 2011


I have a file pcount.erl and pcount.hrl

pcount.hrl



On Tue, May 10, 2011 at 4:33 PM, Ahmed Omar <> wrote:
> I'm not sure i understand what u r trying to do exactly. but are u trying to
> do
> -define(FILE, "somepath").
> in some.hrl?
> cause ?FILE is a predefined macro that is expanded to the name of the
> current module, you can't redefine it.
>
> On Tue, May 10, 2011 at 11:36 PM, Wes James <> wrote:
>>
>> I was trying to do something like this:
>>
>> -include("some.hrl").
>> -include(?FILE).
>>
>> Where FILE is defined in some.hrl, but found that can't be done.   I
>> was trying to define a path to a hrl file without having it show in
>> the actual file on github.  I guess the way to do this is with an
>> environment variable, if I'm worried about it.
>>
>> I found info on macros in "The Preprocessor" page on erlang.org
>>
>> http://www.erlang.org/doc/reference_manual/macros.html
>>
>> -wes
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
> --
> Best Regards,
> - Ahmed Omar
> http://nl.linkedin.com/in/adiaa
> Follow me on twitter
> @spawn_think
>



More information about the erlang-questions mailing list