An "is_string" BIF?

Thomas Johnsson XA (LN/EAB) <>
Thu Mar 10 09:21:36 CET 2005

This really exposes an ugly wart on the language, in that 
one cannot use any expression in a guard, making it impossible
to use abstractions there, e.g.

glorbgraph(Graph) when mygraph:curiousproperty(Graph) -> ...

-- Thomas

-----Original Message-----
[mailto:]On Behalf Of Corrado Santoro
Sent: den 10 mars 2005 09:02
Subject: An "is_string" BIF?

Dear all,

I need an "is_string" function, something that behaves as follows:

is_string ("ABC") -> true
is_string ([65,66,67]) -> true
is_string (['1','2',three]) -> false

I know that I could do that by defining a suitable function, but I would 
like to use it in a guard. Is there a sort of BIF?



More information about the erlang-questions mailing list