An "is_string" BIF?

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Thu Mar 10 10:14:39 CET 2005

From: "Thomas Johnsson XA (LN/EAB)" <thomas.xa.johnsson@REDACTED>
> 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

The real problem is that guards must be guaranteed to be side-effect free... I
think (but am no compiler expert) that it should be possible to (very)
conservatively tag functions as 'side-effect free'. Hopefully these functions
will not be so restricted as to become useless [*]

The other problem is that guards should evaluate in bounded time. This is much
harder to control, but maybe it's not a hard requirement?


[*] They should only call other 'side-effect free' functions - since we don't
have global compilation, there is no guarantee that external calls are
side-effect free, so this limits usefulness quite a lot. Bifs should be ok, but
not necessarily across releases.

So it seems this is a big can of worms :-)

More information about the erlang-questions mailing list