Added several function tables to perform sequence operations -
SequenceFunctions,
VarSequenceFunctions - giving functions
like c(...), rep() and cycle.
addFunctionTable(SequenceFunctions)
to access these.
Added general subset overloading via interpreted and utility functions
(addFunctionTable access)
and implemented some examples for XML.
Lazy and variable argument lists handled by internal
compiled functions added to the evaluator via
addFunctionTable
Switch(), time()
and Quote()
x = "a" Switch(x,a=1, b=10, c="z"); time(foo(y)); Quote(1::20 + 1)
Introduction of the global keyword
to allow interpreted user-level class methods to refer
to global methods and functions without conflicting with
methods local to the class.
Compiled user-level classes supporting interpreted methods.
class Dummy extends util.Vector {
function addElement(x) {
if(x instanceof String)
x = x.trim();
super.addElement(x);
}
function foo() {
}
}
Enhanced byte-code generation facilities.
Methods in user-level classes can find methods in the implicit
this
rather than looking up global functions or methods
(i.e. evaluator methods).
class A extends util.Vector {
function addElement() {
..
size(); // size method in A (inherited from Vector)
trim(x); // "global" scoped method
}
}
Added casting support
B gives
the result B.
Casting the instance to A and invoking the method
on the resulting reference gives A
[] b = new B()
[] b.foo()
B
[] ((A)b).foo()
A
Optional single container for Class lists. (Sun Oct 3 '99)
Whether this is used or the old group-by-package class is used
is controlled by the option groupedClassList
which should be true or false.
This can be specified on the command line as
-DgroupedClassList=true
or in the OmegaOptions as
groupedClassList: true
Note that it cannot be effectively set in one's
.omegahatrc
file as the class list will have been created at this point.
numeric in
the Omegahat package(s). Because of the way the directories are
list, the class
DataStructures.numeric
is found before
ObjectDataStructures.numeric
To change this, we can simply remove the entry
org/omegahat/Environment/ObjectDataStructures
from the appropriate entry in the classLists() object.
[] numeric
class org.omegahat.Environment.DataStructures.numeric
[] classLists()[[0]].remove("org/omegahat/Environment/ObjectDataStructures")
[] numeric
class org.omegahat.Environment.ObjectDataStructures.numeric
(Obviously, the position 0 may not be the appropriate element.
This depends on the value of the user's CLASSPATH.
We can check which entry we want with the command
[] classLists().orderedKeys() [/home/duncan/Scratch/org/.., /home/duncan/Scratch/org/omegahat/Jars/swingall.jar, /usr/local/src/jdk1.2/lib/classes.zip, /home/duncan/Scratch/org/omegahat/Jars/antlr.jar, /home/duncan/Scratch/org/omegahat/Jars/jas.jar, /home/duncan/Scratch/org/omegahat/Jars/jhall.jar, /u3/local/src/jdk1.2/jre/lib/rt.jar, /u3/local/src/jdk1.2/jre/lib/i18n.jar, /u3/local/src/jdk1.2/jre/classes]So we could use the command
[] classLists()[[new File("/home/duncan/Scratch/org/..")]].remove("org/omegahat/Environment/ObjectDataStructures")
If the CLASSPATH variable is is not set,
the omegahat script arranges to have the Omegahat packages located
first in the list.
^ and % operators
increased. Tues 28 Sept. '99
*, / and :.
[1] x= new double[]{1,2,3}
1.0
2.0
3.0
[2] x + 10
11.0
12.0
13.0
[3] x + new double[]{10,100}
11.0
102.0
13.0
[4] x - 100
-99.0
-98.0
-97.0
There are still cases that this does not cover.
This is in response to
David Jame's report.
[1] x = new util.Vector(); x[[0]] = "foo"
[2] x.elementAt(0.) // note that 0. is a Double
will now match the method
java.util.Vector.elementAt(int)
See MethodCall.transformArguments()
and MethodLocator.matchClass()
This breaks some of the method dispatching.