Compiler bug

Hakan Stenholm etxhste@REDACTED
Fri Apr 12 14:03:08 CEST 2002


>I found a compiler bug in R8B-0.  Here is the simplest test case
>I could come up with:
>
>-module(compiler_bug).
>-export([test/1]).
>
>test(A) when not is_list(A) -> A.

This shouldn't work:
* you can't use user defined functions (like is_list/1) in a guard, 
  only type checks: 
  atom/1, constant/1 ,float/1, integer/1, list/1, number/1, pid/1, 
  port/1, reference/1, tuple/1, binary/1, record/2
  
  comparision operartors: 
  >,<,=<,>=,==,/=,=:=,=/=
  
  and some bifs (together with arithmeteric ops): 
  element/2, float/1, hd/1, length/1, round/1, self/0, size/1,
  trunc/1, tl/1, abs/1, node/1, node/0, nodes/0
  
* I'm not sure if "and", "or" and "not" can be used (, and ; can be used in a 
  when statement to get "and" and "or" behaviour).  




More information about the erlang-questions mailing list