Runtime type information (RTTI) alows "investigate" a
object "published" properties and events, so, an "object
inspector" can be build.
Also, "Classname" and "inheritsFrom" are a nice thing.
I can't help on how to investigate an object's published
properties and functions :( , but I made a try at a
Classname and an Inheritsfrom that work on class
instances:
Every time you create a new "CORE_OBJECT" in
a "CORE_MODULE" you must register it classname and all
methods and properties. It seems to be stored in a table,
well, we can search in this table to retrieve all registered
props/methods.
This could be very handy when creating visual environments
for dialect (i have seen a "visual dialect" request :) )
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Every time you create a new "CORE_OBJECT" in
a "CORE_MODULE" you must register it classname and all
methods and properties. It seems to be stored in a table,
well, we can search in this table to retrieve all registered
props/methods.
This could be very handy when creating visual environments
for dialect (i have seen a "visual dialect" request :) )
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Rodrigo,
You already can search the table you talk about. Run e.g.
the following:
import "gui"
print gui
There is however a practical limit: the frame you can search
contains only names of classes, functions, properties and
constants. The additional information , what's in a class,
parameters needed, ranges allowed, etc. is not available.
These would need to be added to be able to 'browse
objects'...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=423153
I can't help on how to investigate an object's published
properties and functions :( , but I made a try at a
Classname and an Inheritsfrom that work on class
instances:
class examplegrandparent
endclass
class exampleparent(examplegrandparent)
endclass
class exampleclass( exampleparent )
endclass
x = exampleclass()
classname = func( ci )
return type(ci)
endfunc
inheritsfrom = func( ci )
return split( (unparse( ci.inherited ))[2->-2], "=")
[2]
endfunc
print classname( x ), cr # works on
class instance
print inheritsfrom(x), cr # works on
class instance
print inheritsfrom(inheritsfrom(x)),cr # doesn't work
on a class
dummy = eval( inheritsfrom(x))() # So
sometimes a trick works...
print inheritsfrom(dummy ), cr
Andr
Logged In: YES
user_id=742111
Every time you create a new "CORE_OBJECT" in
a "CORE_MODULE" you must register it classname and all
methods and properties. It seems to be stored in a table,
well, we can search in this table to retrieve all registered
props/methods.
This could be very handy when creating visual environments
for dialect (i have seen a "visual dialect" request :) )
Logged In: YES
user_id=742111
Every time you create a new "CORE_OBJECT" in
a "CORE_MODULE" you must register it classname and all
methods and properties. It seems to be stored in a table,
well, we can search in this table to retrieve all registered
props/methods.
This could be very handy when creating visual environments
for dialect (i have seen a "visual dialect" request :) )
Logged In: YES
user_id=423153
Rodrigo,
You already can search the table you talk about. Run e.g.
the following:
import "gui"
print gui
There is however a practical limit: the frame you can search
contains only names of classes, functions, properties and
constants. The additional information , what's in a class,
parameters needed, ranges allowed, etc. is not available.
These would need to be added to be able to 'browse
objects'...