next up previous index
Next: Application hooks Up: Miscellaneous Previous: System operations   Index

Reflection

In msg.diesel:

This file includes primitives allowing the Diesel program access to the run-time system's compiled code and method lookup tables, thus supporting reflection.

extend module Stdlib;
module Reflection;
module Message;
fun send(msg_name:string, num_params:int,
                args:ordered_collection[dynamic]):dynamic;
fun send(msg_name:string, num_params:int,
                args:ordered_collection[dynamic],
                if_error:&():dynamic):dynamic;
fun field_init_send(msg_name:string, num_params:int,
                           args:ordered_collection[dynamic],
                           if_error:&():dynamic):dynamic;
fun prim_resend(msg_name:string, num_params:int,
                       args:ordered_collection[dynamic],
                       dirs:ordered_collection[dynamic],
                       is_undirected:bool, if_error:&():dynamic):dynamic;
fun directed_field_init_send(msg_name:string, num_params:int,
                                    args:ordered_collection[dynamic],
                                    dirs:ordered_collection[dynamic],
                                    if_error:&():dynamic):dynamic;
end module Message;
module Inheritance;
fun type_id(t:any):int;
fun inherits_from(obj1:any, obj2:any):bool;
end module Inheritance;
module Breakpoint;
fun set_breakpoint(msg_name:string):void;
fun show_breakpoints():void;
end module Breakpoint;
end module Reflection;
In env.diesel:

evaluation_envs support Diesel program access to its runtime state, for debugging and fast expression evaluation purposes.

extend module Stdlib;
extend module Reflection;
module Environment;
abstract class evaluation_env;
  fun lexically_enclosing_env(:evaluation_env,
                                     if_none:&():evaluation_env
                                     ):evaluation_env;
  fun lookup(e:evaluation_env, s:string, num_params:int,
                    if_absent:&():dynamic,
                    if_error:&(string):dynamic):dynamic;
  fun lookup_assign(e:evaluation_env, s:string, num_params:int,
                           value:dynamic,
                           if_absent:&():void, if_error:&(string):void):void;
  fun find_defining_env(e:evaluation_env, s:string, num_params:int,
                               if_absent:&():evaluation_env,
                               if_error:&(string):evaluation_env
                               ):evaluation_env;
  fun fetch(:evaluation_env, s:string, num_params:int,
                   if_absent:&():dynamic, if_error:&(string):dynamic):dynamic;
  fun fetch_object(:evaluation_env, s:string, num_params:int,
                          if_absent:&():dynamic, if_error:&(string):dynamic
                          ):dynamic;
  fun assign(:evaluation_env, s:string, num_params:int, value:dynamic,
                    if_absent:&():void, if_error:&(string):void):void;
  fun defines_var(:evaluation_env, s:string, num_params:int,
                         if_error:&(string):bool):bool;
  fun add_var_decl(e:evaluation_env, name:string, is_constant:bool,
                          type_annotation:string, value:dynamic,
                          if_error:&(string):none):void;
  fun add_var_decl(e:evaluation_env, name:string, num_params:int,
                          is_constant:bool, is_abstract:bool,
                          type_annotation:string, value:dynamic,
                          if_error:&(string):none):void;
  fun local_vars_do(:evaluation_env,
                           cl:&(name:string, is_constant:bool,
                                type_annotation:string):void):void;
  fun decl_context_string(:evaluation_env):string;
  fun is_static_env(:evaluation_env):bool;
  fun module_name(e:evaluation_env):string;
  fun module_name(:evaluation_env, if_error:&():string):string;
object empty_env isa evaluation_env;
abstract class debuggable_env isa evaluation_env;
  fun debugger(env:debuggable_env, print_frame:bool):void;
object global_env isa debuggable_env;
  var field extensions(e:global_env):evaluation_env;
fun create_anon_object(r:global_env, parent:dynamic,
                              if_error:&(string):dynamic):dynamic;
fun create_named_object(r:global_env, s:string, num_params:int,
                               is_abstract:bool,
                               parents:indexed[dynamic],
                               if_present:&():dynamic,
                               if_error:&(string):dynamic):dynamic;
abstract class runtime_env isa debuggable_env;
fun current_env():runtime_env;
fun my_caller(if_none:&():`T):runtime_env|T;
fun my_caller():runtime_env|global_env;
fun caller(r:runtime_env, if_none:&():`T):runtime_env|T;
fun extend_method_table(meth_name_oop:string, num_params:int,
                               specializers:ordered_collection[dynamic],
                               method_object:runtime_extension_method,
                               interpret_interrupts:bool,
                               if_error:&():bool):bool;
end module Environment;
end module Reflection;
end module Stdlib;


next up previous index
Next: Application hooks Up: Miscellaneous Previous: System operations   Index

Cecil/Vortex Project