I once developed a macro which would take the enclosed code block and write it to a file which would then later be include
d in another julia process. In principle I just print
ed the expression into the file which would then happly run once included - in julia v1.3:
julia-1.3> print(:(r = r"""45 " """))
r = #= REPL[1]:1 =# @r_str("45 \" ")
However with julia v1.4 this does not work anymore, since quotes in triple-quoted strings and escaped quotes in quoted strings are not faithfully represented anymore if they appear in a non-standard string literal:
julia-1.4> print(:(r = r"""45 " """))
r = r"45 " "
julia-1.4> print(:(r = r"45 \" "))
r = r"45 " "
in normal string everything seems fine:
Julia-1.4> print(:(r = "45 \" "))
r = "45 \" "
Is there another way I should use to print an expression such that it can be included again?
Thanks