Created
October 28, 2009 20:00
-
-
Save leandrosilva/220766 to your computer and use it in GitHub Desktop.
A function to convert "list" to "term"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| list_to_term(String) -> | |
| {ok, T, _} = erl_scan:string(String ++ "."), | |
| case erl_parse:parse_term(T) of | |
| {ok, Term} -> | |
| Term; | |
| {error, Error} -> | |
| Error | |
| end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment