Reflection/Get source: Difference between revisions

m
m (syntax highlighting fixup automation)
m (→‎{{header|Wren}}: Minor tidy)
 
Line 595:
{{libheader|Wren-pattern}}
Wren doesn't have reflection as such but the command line version (Wren CLI) does have an easy way to obtain a script's own source code which can then be searched for where an object is defined
<syntaxhighlight lang="ecmascriptwren">import "os" for Platform, Process
import "io" for File
import "/.pattern" for Pattern
 
var getSourceLines = Fn.new {
Line 629:
{{out}}
<pre>
File name : reflection_get_sourceReflection_get_source.wren
Function name : getSourceLines
Line number : 5
9,479

edits