principle of least surprise

Alex Arnon alex.arnon@REDACTED
Tue Nov 22 14:58:30 CET 2005

Could it be possible to trace the execution of such a function executing in
a guard, and raise an exception if it performs a side-effect-causing
operation? AFAIK the set of such operations is rather small in erlang: (off
the top of my head)
- Message sends.
- Side-effect inducing BIFs (which can be marked as part of their

So if we keep a "side-effect allowed" flag stack along (or as part of) the
process stack, implementation should be easy... or would it? :)

I find this feature to be highly desirable, even more than the
multi-scheduler VM that will surely grace us with its presence Real Soon
Now. :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the erlang-questions mailing list