Any and EAny types

The EGL Any type is a reference type that lets you create a variable whose data type is not fixed. The EDT implementation of Any is EAny.

EGL package name

eglx.lang

Example use
You typically need to use the as operator to cast a variable as a non-Any type, as in the following example:
myInt INT = 42;
myAny ANY = myInt;
myInt = myAny as INT + 38;
Type detail
In the following detail, the Operation annotation indicates that the specified operation is available. For example, use “==” to compare two values, not “$EQ”. Two exceptions are the widen and narrow operations, which are invoked during data conversions; for example, when the as operator is used.
   /*********************************************************************
   * The supertype of all other types; can reference any type of value. *
   *********************************************************************/
externalType EAny type ClassType

   /* {@Operation ==} compares two values of type any.                 */
   static function $EQ(lvalue EAny in, rvalue EAny in)
      returns(EBoolean) {@Operation{"=="}};

   /* {@Operation !=} compares two values of type any.                 */
   static function $NEQ(lvalue EAny in, rvalue EAny in) 
      returns(EBoolean) {@Operation{"!="}};

   /* {@Operation widen} Converts to an any,
   *  as used in a boxing conversion                                   */
   static function asAny(value EAny in) 
      returns(EAny) {@Operation{"widen"}};
end
Comments
When you assign a value to an Any type variable, EGL knows the type of that value at run time, but not at development or generation time. You can assign an Int value to an Any type variable at one point in your program, and assign a String or Hex value to the same variable at a later time.
Compatibility
Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.