2009/11/11 Mark Proctor <mproctor@codehaus.org>:
Wolfgang Laun wrote:
And, perhaps, think about adding (relatively) simple things like
permitting, in DRL
import static ...;
you can already do this, but we call it import function. We just haven't
done the mapping to allow functions to be imported from different
namespaces, when they are defined in a drl, instead of on a java class.
final static String foo = ...;
This sounds like you want constants defined? I think we need to think more
on the whole area of constants, data initialisations and setup etc.
Exactly. Right now, I can import a class and access its static finals, using
Class.FIELD. But occasionally it's more convenient (also for maintenance) to
define them locally. (Defining a function returning a value is an acceptable
workaround for simple types and String.)
Initialisation: Yes, for instance, the "global" thing is more like a
workaround than a
solution ;-)
We went with "import function" instead of "import static" as we weren't
sure if anything more than a function would ever be imported, i.e. we
ignored the idea of static fields. We can re-address that, likewise the
importantion of functinos and static "constants" from other namespaces.