Defines not supported inside guard expressions #2

helllamer opened this Issue Aug 2, 2012 · 1 comment


None yet

2 participants


It looks like, defines is not properly substituded in guard expressions.

-module(ar_test_controller, [Req]).

-define(is_ok(X), is_list(X)).

test('GET', [X]) when ?is_ok(X) ->

rebar compile cause following error:

ERROR: pre_compile failed while processing /home/user/chicagoboss/ar:
make: *** [erl] Error 1

Guard expressions for case clauses produces same errors.


Thanks. I am aware of the problem. Right now macros are compiled to funs (which aren't allowed in guards) but this behavior should change.

@drlinux drlinux referenced this issue in drlinux/erl_slug Jan 19, 2015
@drlinux drlinux Update erl_slug.erl 6e98ba0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment