illegal guard expression with lists:nth

Roberto Ostinelli roberto@REDACTED
Thu Jun 11 11:37:42 CEST 2009


dear all,

why does the following expression give me an 'illegal guard  
expression' at compile?

if
	lists:nth(2, List) =:= "test" ->
[...]

lists:nth returns a term, thus i should be enabled to use it. on the  
contrary, the following expression is accepted:

if
	length(List) =:= 3 ->
[...]

am i missing a point?

r.



More information about the erlang-questions mailing list