Unified data type system and method
First Claim
1. A computer storage medium storing computer executable instructions that when executed by a processor provide a unified type system for use with a computer source language and associated components which translate source files written in the computer source language into executable form and execute the translated source files, wherein at least one source file declares a variable using an unboxed value type representation yet passes the variable to a method expecting a boxed value type representation, the unified type system comprising:
- a first value type representation relating to the unboxed value type representation of the variable;
a class object hierarchy comprising a plurality of object classes, wherein at least one of the object classes is a second value type representation relating to the boxed value type representation of the variable, wherein the second value type representation is automatically passed to the method expecting the boxed value type representation; and
whereina trigger located in the source file indicating a required conversion from the unboxed value type representation to the boxed value type representation when it is detected that the method expects the boxed value type representation, wherein as part of translating the source files and executing the translated source files maintaining both the boxed value type representation and the unboxed value type representation.
1 Assignment
0 Petitions
Accused Products
Abstract
A type system includes a dual representation for basic data types. One representation is the basic data type representation common to such basic built-in data types, known as an unboxed value type or simply as a value type. Each of the basic data types also has a boxed representation that can be stored in the object hierarchy of the type system. This dual representation can also be extended to user-defined types, so that user-defined types may exist both as an unboxed value type and as an object within the object hierarchy of the type system. This dual representation allows the compiler and/or runtime environment to select the most effective and efficient representation for the data type depending on the particular need at the moment.
-
Citations
14 Claims
-
1. A computer storage medium storing computer executable instructions that when executed by a processor provide a unified type system for use with a computer source language and associated components which translate source files written in the computer source language into executable form and execute the translated source files, wherein at least one source file declares a variable using an unboxed value type representation yet passes the variable to a method expecting a boxed value type representation, the unified type system comprising:
-
a first value type representation relating to the unboxed value type representation of the variable; a class object hierarchy comprising a plurality of object classes, wherein at least one of the object classes is a second value type representation relating to the boxed value type representation of the variable, wherein the second value type representation is automatically passed to the method expecting the boxed value type representation; and
whereina trigger located in the source file indicating a required conversion from the unboxed value type representation to the boxed value type representation when it is detected that the method expects the boxed value type representation, wherein as part of translating the source files and executing the translated source files maintaining both the boxed value type representation and the unboxed value type representation. - View Dependent Claims (2, 3, 4)
-
-
5. A method for use by a compiler executing on a processor, the compiler compiling source code into executable intermediate language code, the method comprising:
-
upon detecting in the source code a trigger to pass an unboxed value type representation of a variable of a first value type to a method expecting a boxed value type representation, inserting, in the intermediate language code, a boxing instruction, wherein the boxing instruction when executed creates a boxed value type representation of the variable based on the first value type and wherein the boxing instruction does not correspond to an explicit instruction in the source code for creating a boxed value type representation of the variable, wherein as part of compiling the source files and executing the compiled source files maintaining both the boxed value type representation and the unboxed value type representation. - View Dependent Claims (6, 7, 8)
-
-
9. A computer storage medium storing computer executable instructions for a compiler that translates files written in at least one computer source language into computer executable files, wherein when the instructions are executed the compiler translates a computer source language file, containing computer source language instructions to assign an unboxed value type representation of a variable and to pass the unboxed value type representation to a method expecting a boxed value type representation, into an executable file containing instructions that create both an unboxed value type representation of the variable and a boxed value type representation of the variable;
- and wherein
a trigger in the source file indicates a required conversion from the unboxed value type representation to the boxed value type representation, wherein as part of translating the source files and executing the translated source files maintaining both the boxed value type representation and the unboxed value type representation. - View Dependent Claims (10, 11)
- and wherein
-
12. A computer system for providing an expected value type representation to a requesting method, the computer system comprising:
-
at least one processor; and at least one memory, communicatively coupled to the at least one processor and containing computer-readable instructions that, when executed by the at least one processor, perform a method comprising; storing in a source code file a declared representation of a variable, wherein the declared representation is an unboxed value type representation of the variable; detecting a trigger in the source file indicating that the requesting method requests the variable in an expected value type representation; wherein when the expected value type representation is a boxed value type representation; automatically converting the unboxed value type representation to the boxed value type representation; and maintaining both the unboxed value type representation and the boxed value type representation in memory; and providing the expected value type representation to the requesting method. - View Dependent Claims (13, 14)
-
Specification