[erlang-questions] No Namespace for Macros

Attila Rajmund Nohl attila.r.nohl@REDACTED
Thu Oct 15 16:08:47 CEST 2009


Macros (and records) can be defined outside modules, unlike functions.
I think they are handled by a "preprocessor", not the compiler. Don't
forget that macros in C++ are also outside classes and namespaces -
the Erlang macro is modeled more like the C/C++ macros, not like Java
variables.

2009/10/15, sapan shah <sapan.gcet@REDACTED>:
> As Anupag said it rightly & Bengt showed... there is a way around..
> But my curiosity is,
> If it is for functions, why it is not for macros??? What would the
> developers of Erlang have thought & made it like that???
>
> On Thu, Oct 15, 2009 at 12:05 PM, Anupam Kapoor
> <anupam.kapoor@REDACTED>wrote:
>
>> ofcourse another way to skin the cat is to return constants from
>> functions in different modules...
>>
>>
>> On Thu, Oct 15, 2009 at 11:54 AM, Anupam Kapoor <anupam.kapoor@REDACTED>
>> wrote:
>> >> For exapmle, Java supports this (public static final variables).
>> >>
>> >> Any Explanation?????
>> > erlang doesn't have any notion of objects. in java, each '.java' file
>> > contains a corresponding class-definition, and you can have multiple
>> > instances of those objects defined...
>> >
>> > kind regards
>> > anupam
>> >
>> > --
>> > In the beginning was the lambda, and the lambda was with Emacs, and
>> > Emacs was the lambda.
>> >
>>
>>
>>
>> --
>> In the beginning was the lambda, and the lambda was with Emacs, and
>> Emacs was the lambda.
>>
>
>
>
> --
> Regards,
> Sapan Shah
>


More information about the erlang-questions mailing list