Recent Changes for Environment

See also Language.
  • The interactive environment can be invoked directly from a Jar file as
      java -jar Environment.jar
    
    The antlr, jas and jhelp files must be in the parent directory of the one containing the Environment.jar. This also requires Java 2.
  • Killed off the warning message about the jre/classes not being a directory or archive when Omegahat starts up.
    See warnDirectory() in ObjectList
  • Added a version of findClass which has an integer second argument which controls whether ClassNotFoundExceptions are consumed or not.
    This is useful in interpreted scripts such as one's .omegahatrc for conditionally doing things if classes have been compiled/installed. For example,
    if(findClass("FormulaParsing",-1) != null)
      addFunctionTable(FormulaParsing);
    if(findClass("VarSequenceFunctions",-1) != null)
      addFunctionTable(VarSequenceFunctions);
    
  • Notification of duplicate class resolution
    Omegahat does dynamic class resolution by looking through the search path and returning the first that matches. This can yield results that are dependent on the order of the elements in the classpath. While one can use partial qualification (e.g. util.Vector), the interpreter can be told to warn of such duplication. This is done by setting the global variable ShowMultipleClasses of BasicEvaluator to true (A good place to do this is in the user initialization file, .omegahatrc file in your home directory.) A warning is generated if more than one class is located.
    [1] this.ShowMultipleClasses = true
    true
    [2] Vector
    Found 2 classes named Vector
    	0) class antlr.collections.impl.Vector
    	1) class java.util.Vector
    class antlr.collections.impl.Vector
          

    Of course, turning this feature on helps identify potential problems based on unqualified name assumptions, but also slows things down by forcing searches to be performed for all entries in the package lists rather than terminating when the class is found.

  • Interpreted function listeners
    The dynamically generated code that is used to implement interpreted function listeners is now thread safe, using a local instance of FunctionCallArguments to store the method's variables and is passed to the eval(List) method.

    This is the same mechanism currently being used to implement interpreted classes.

  • User initialization script.
    The omegahat script $HOME/.omegahatrc is now source()d at the end of OmegaInit script.

    This can be turned off using the flag -u of the omegahat script.

    A different file can be specified via the argument trailing a +u flag.

           omegahat +u /tmp/alternativeScript
    

  • Duncan Temple Lang <duncan@research.bell-labs.com>
    Last modified: Sun Mar 5 18:58:29 EST 2000