I am currently trying to figure out how to compile and instantiate a dynamically created class and have been looking at the code in Evaluator.fan from within Fansh for guidance. When creating a CompilerInput instance it initialises the srcStrLoc field as srcStrLoc = Loc("Fansh").
My (first?!) question is what is srcStrLoc actually used for? In the documentation it simply states "Location to use for SourceFile facet (str mode only)" but I don't understand what this means in this context.'srcStr' references the actual script to be compiled, in this case an in-memroy string, but what does the term facet refer to in the definition of srcStrLoc?
Bob
brianThu 21 Feb 2013
Basically it just means the "filename" that will displayed in a stack trace for the set of classes compiled from the string
Bob147 Thu 21 Feb 2013
I am currently trying to figure out how to compile and instantiate a dynamically created class and have been looking at the code in Evaluator.fan from within Fansh for guidance. When creating a CompilerInput instance it initialises the srcStrLoc field as srcStrLoc = Loc("Fansh").
My (first?!) question is what is srcStrLoc actually used for? In the documentation it simply states "Location to use for SourceFile facet (str mode only)" but I don't understand what this means in this context.'srcStr' references the actual script to be compiled, in this case an in-memroy string, but what does the term
facet
refer to in the definition ofsrcStrLoc
?Bob
brian Thu 21 Feb 2013
Basically it just means the "filename" that will displayed in a stack trace for the set of classes compiled from the string