On Monday, August 31, 2015 at 11:28:47 AM UTC-4, Peter Simon wrote:
>
> It seems that
>
> include_string("[1,2,3]")
>
> also works. Is there any reason to prefer one or the other of these
> techniques over the other?
>
eval and parse give you more low-level control (see the docs for eval and
parse for more options), and you can also look at (or modify) the parsed
syntax tree if desired.
include_string is nicer if you want to parse and eval a whole bunch of
statements just as if they appeared in an included file. You can even
supply a "filename" argument so that the "filename" and line number will be
reported in backtraces. e.g. this is what IJulia does when it evaluates
code cells in the Jupyter interface.