class REFLECT
****
Avoid using this class. Use REFLECT_INCLUDE, instead, if possible. REFLECT is the most dangerous of the reflection classes, and permits arbitrary breakage of encapsulation and type-safety in any class. It allows you to create, inspect and modify (including private attributes) objects of any type.
_
___"There_are_wonderous_things_out_here.__Treasures_to_satiate
__your_every_desire,_both_subtle_and_gross"__--_Q_,from_Star_Trek
_
Warning! This class is *not* part of the specification. and should *ONLY* be used for writing extra-linguistic tools. such as debugging or persistance. Not for standard libraries.
_
Usage:
____b_::=_#FOO;_n_attrs_in_b:_INT_:=_REFLECT::n_attribs(o)


Flattened version is here



Public


Features
array_element(o:$OB,i:INT):$OB
array_size(o:$OB):INT
attrib(o:$OB,i:INT):$OB
**** Return the "i" th attribute of object "o"
attrib_name(o:$OB,i:INT):STR
**** Return the name of the "i"th attribute of object "o"
create_object(i:INT):$OB
**** Create a new object whose type tag is "i"
create_object(i:INT,asize:INT):$OB
**** Create a new array object of arbitrary type (i specifies the type tag)
n_attribs(o:$OB):INT
**** Return the number of attributes of object"o"
set_array_element(o:$OB,i:INT,n:$OB)
set_attrib(o:$OB,i:INT,n:$OB)
**** Set the "i"th attribute of object "o" to "n"
tp_for_str(class_name: STR): INT
**** Returns the type tag associated with the class name "class_name" Returns 0 if no such tag exists (0 is never a valid tag) This function should be in SYS, but is only possible with the reflection information


Private

ok_array_elt(o: $OB,i: INT): BOOL
ok_attrib(ob: $OB, i: INT): BOOL

The Sather Home Page