I know Introspection can tell me about classes that Ive already instantiated, but is there a way to see what classes are actually in the program? I suspect the answer is no for many reasons
What I was thinking of was being able to create a list of available subclasses that I didnt have to update every time I added one. Something that could get a list of all the subclasses of something and make a menu of them so I could choose to create instances of them via a UI.
I could do this with a pre-compile script I think, something that looked at the code or at the actual files and figured it out and wrote me a resource file, but then Im not sure how I would instantiate them as my code would have to access them by name after the fact somehow.
Im really thinking its not going to work or not going to be worth the effort of making scripts that alter code, but since its an interesting idea I thought Id ask to see if anyone else has done anything similar.
if you never use the class in code it will be stripped
so it may exist in source code but wont exist in the compiled app
at best a module that just does
dim obj as Object
if obj isa <name of class here> then
end if
over and over one for every class
and you could alter that in a precompile script
now the code will exist but introspection has no way to get at it anywayuntil / unless you create an instance
may be something to ask Thomas Tempelmann’s to implement in Arbed ?
adding a module with everything in your source code that you may / may not actually use in your code would just make your app fatter than it might need to be
I dont write code Im not going to use
Compat flags make it entirely possible to do so
And there might be good reason - have a method that for desktop does one thing
Same module dropped into a console app there might be a method with the same sig does something else
Right no thats trickier to do with classes but certainly possible
Not really radically different than what I outlined in a prerelease post you can read
https://forum.xojo.com/conversation/post/449253