[erlang-questions] For your amusement--why doesn't this compile?

Brujo Benavides <>
Mon Jan 30 16:29:43 CET 2017


Strangely enough, this actually generates a different warning:

-module(weird).
-define(PLEASE_DONT).
-ifdef(PLEASE_DONT).
-compile({parse_transform,undefined_parse_transform}).
-endif.

1> c(weird).
src/weird.erl:2: badly formed 'define'

> On Jan 30, 2017, at 12:27, Brujo Benavides <> wrote:
> 
> Well… this on the other hand, compiles:
> 
> -module(weird).
> -define(PLEASE_DONT, true).
> -ifndef(PLEASE_DONT).
> -compile({parse_transform,undefined_parse_transform}).
> -endif.
> 
>> On Jan 30, 2017, at 12:24, < <mailto:>> < <mailto:>> wrote:
>> 
>> Here’s a behaviour that’s had me tearing my hair today. Consider this module:
>>  
>> -module('Aaargh!!').
>> -define(PLEASE_DONT).
>> -ifndef(PLEASE_DONT).
>> -compile({parse_transform,undefined_parse_transform}).
>> -endif.
>>  
>> It fails to compile, with one simple error message:
>>  
>> 20> c('Aaargh!!').
>> Aaargh!!.erl: undefined parse transform 'undefined_parse_transform'
>> error
>>  
>> If you can see why, you’re more an Erlang wizard than I am!
>>  
>> John
>> _______________________________________________
>> erlang-questions mailing list
>>  <mailto:>
>> http://erlang.org/mailman/listinfo/erlang-questions
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170130/ef7da1ca/attachment.html>


More information about the erlang-questions mailing list