[DGD] RFC: Creator arguments

Mikael Lind mikkelin at gmail.com
Thu Dec 14 21:06:20 CET 2006


Hello,

I do not know if this has been suggested before, but I think that it
would sometimes be useful to be able to pass arguments along to
create() when creating an object with clone_object() or new_object(),
and possibly also with compile_object. It seems that it would be
fairly straightforward implementing this at the ~System level, with a
system auto object and a system creator function.

The system auto object would mask new_object() and clone_object(),
changing their signatures:

object new_object(mixed obj, varargs mixed args...)
object clone_object(mixed obj, varargs mixed args...)

And possibly also:

object compile_object(string path, varargs mixed args...)
object compile_string(string path, string source, varargs mixed args...)

Passing additional arguments to a recompilation call or to a lib
compile would raise an error.

I have not made myself familiar with TLS yet, but I believe it could
be used to pass the arguments along to the system creator function.
The system creator function would call create() with rlimits
restrictions, passing along the arguments. The system creator function
would then return true to request that the Kernel Library does not
also call create().

It may also be a good idea to destruct clones that raise an error in create().

Regards,
Mikael



More information about the DGD mailing list