class file extends net.dijkstracula.melina.stdlib.vector<Long> {}
class net extends net.dijkstracula.melina.stdlib.net<IvyObj_msg_t> {}
In particular, the argument to the module is always currently translated into a type parameter.
Unfortunately this is clearly the wrong thing to do with net and probably also not the right thing with vector, since we need to initialize program state within net (in particular, the backing array of Sockets).
So, this should probably simply construct an object that behaves like a Factory instead.
VectorFactory<Long> file = new VectorFactory<Long>(); // Stateless: file.empty() produces a Vector, etc...?
Network<IvyObj_msg_t> net = new Network(); // Stateful: net.dial(42) sets up an internal routing table for pid 42
I actually wonder if the thing we need to do is make this true for all user-defined types (the remaining ones being enums and (parameterized) processes?)
Currently, we extract an Ivy statement that declares an instantiation of a module such as
to a subclass of the backing Java object:
In particular, the argument to the module is always currently translated into a type parameter.
Unfortunately this is clearly the wrong thing to do with
net
and probably also not the right thing withvector
, since we need to initialize program state withinnet
(in particular, the backing array of Sockets).So, this should probably simply construct an object that behaves like a Factory instead.