Include_string third argument fname


#1

Hi,

What is the meaning / use of the third argument fname in include_string?
I saw it used this way in IJulia:

include_string(Main, code, "In[$n]")

where n is a number (say 1), In is a mapping of Int to String, which stores code string. So if n=1, In[1] contains code.
I tried the following in the REPL

include_string(Main, "a=1; a+a", "s")

which works at intended, but I do not get the purpose of the third argument.

Thanks,
Bruno


#2
julia> Base.include_string("0//0", "HEEEEEEEEEERE")
ERROR: LoadError: ArgumentError: invalid rational: zero(Int64)//zero(Int64)
Stacktrace:
 [1] Rational{Int64}(::Int64, ::Int64) at ./rational.jl:13
 [2] //(::Int64, ::Int64) at ./rational.jl:40
 [3] include_string(::String, ::String) at ./loading.jl:515
while loading HEEEEEEEEEERE, in expression starting on line 1

and fname = filename.


#3

So it seems that fname argument only serves as an identifier of the code string when an exception is raised.
Thank you!