An "is_string" BIF?

Thomas Johnsson XA (LN/EAB) thomas.xa.johnsson@REDACTED
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-----
From: owner-erlang-questions@REDACTED
[mailto:owner-erlang-questions@REDACTED]On Behalf Of Corrado Santoro
Sent: den 10 mars 2005 09:02
To: erlang-questions@REDACTED
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?

Cheers,
--Corrado

-- 



More information about the erlang-questions mailing list