Evaluate an Erlang Expression

When creating my final year project – Interactive Erlang Notebook – I had to figure out a way of evaluating Erlang expressions. This means taking a line of Erlang code (in string format) and executing it using Erlang.

You’d think it would be easy, but it took a bit longer than expected. Sifting through StackOverflow and going past the first page on a google search, things weren’t looking good.

Quick and Easy

Luckily, after reading the Erlang Docs, I figured it out. Below is an implementation of a function that evaluates Erlang code (in string format) and returns the result.