More on reflection

Monkey Forums/Monkey Bug Reports/More on reflection

ziggy(Posted 2013) [#1]
Make a file named myfile.monkey and use this code:
Import reflection
#REFLECTION_FILTER+="myfile" 

Function Main()
	For Local c:ClassInfo = EachIn GetClasses()
		Print c.Name
	Next
End

Class ThisShouldBeReflected
	Method ThisIsAMethod:Int()
		
	End
End

And get a reflection module was not found! ?

Also, trying to use the reflection sample on documentation, it has badly scaped chars and can't be seen properly.

Also, Mark, could you consider a compiler directive flag such as:
#REFLECT_THIS_FILE so it's easier to add files to the reflection filter in a way that files can be moved from project to project, folder to folder, and still get reflected? Current system makes it complicated to share files between projects if the import hierarchy is not the same in every project and you have to manually edit all the reflection filters of each file for each project compilation.


marksibly(Posted 2013) [#2]
Works OK here on html5/glfw...?


ziggy(Posted 2013) [#3]
But do you get the class in the file to appear in the list of classes? I don't!

EDIT: I do now....?? I promis It was not working! (I know how this sounds...)

EDIT2; I know what was happening. If you declare a class that extends another class that is NOT reflected, then your class is also not reflected, no matter what you put into the Reflection filter.
Not sure if this is intended or not, but it's a little weird (or just I need to get used to it?)