scheffield
scheffield

Reputation: 6787

Evaluate or execute a string in sml

I'm looking for a way to execute as string in sml. For example:

val evalResult = eval "1 + 1";
> val it = 2 : int

I can't actual believe that I didn't find any resource on this topic...

Any help is appreciated.

Upvotes: 0

Views: 189

Answers (1)

Andreas Rossberg
Andreas Rossberg

Reputation: 36118

Short answer: SML, like most typed languages, does not have any eval. And although that would not be impossible, its absence is usually considered a feature. ;)

Upvotes: 6

Related Questions