[erlang-questions] guard clause oddity, maybe bug (in my brain)?

jim rosenblum jim.rosenblum@REDACTED
Fri Nov 20 15:03:43 CET 2015

I have a function:

walk ([I|Is], [Elt|_]=Ts) when (not is_tuple(Elt)) andalso ?IS_INDEX(I) ->
   Element = index_to_element(I,Ts),
       ... snip ...

This function clause gets executed even though Elt is a tuple.

I have a break point within this function clause. I am looking at the
debugger at the break-point within the clause, and I can plainly see that
IS a tuple: within the debugger I can evaluate is_tuple(Elt) and it returns
I can evaluate (not is_tuple(Elt)) and correctly get FALSE.

So.... how can I be in this clause when the guard evaluates to false?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151120/478acc2f/attachment.htm>

More information about the erlang-questions mailing list