Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EDT:EGL Language Primitive Types"
Line 9: | Line 9: | ||
| bgcolor="#999999" align="center" | '''Core''' | | bgcolor="#999999" align="center" | '''Core''' | ||
| bgcolor="#999999" align="center" | '''JavaScript<br>[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352019 Nullable Types]<br>''' | | bgcolor="#999999" align="center" | '''JavaScript<br>[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352019 Nullable Types]<br>''' | ||
− | | bgcolor="#999999" align="center" | '''Java | + | | bgcolor="#999999" align="center" | '''Java''' |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Any'' | | bgcolor="#cccccc" | ''Any'' | ||
Line 16: | Line 15: | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
|- | |- | ||
Line 22: | Line 20: | ||
| value<sup>8</sup> | | value<sup>8</sup> | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
| done<br> | | done<br> | ||
Line 30: | Line 27: | ||
| <br> | | <br> | ||
| [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352020 Dictionary Support]<br> | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352020 Dictionary Support]<br> | ||
− | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352362 Dictionary Support] | + | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352362 Dictionary Support] |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''String(N)'' | | bgcolor="#cccccc" | ''String(N)'' | ||
Line 37: | Line 33: | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
− | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352364 Limited string support] | + | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352364 Limited string support]<br> |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''String'' | | bgcolor="#cccccc" | ''String'' | ||
| <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">reference</span> | | <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">reference</span> | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
| done<br> | | done<br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Date<sup>1</sup>''<br> | + | | bgcolor="#cccccc" | ''Date<sup>1</sup>''<br> |
− | | value | + | | value<br> |
− | + | | <br> | |
− | | <br> | + | | <br> |
− | | <br> | + | |
| <br> | | <br> | ||
|- | |- | ||
Line 58: | Line 51: | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
− | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352366 Timestamp with pattern support] | + | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352366 Timestamp with pattern support]<br> |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Timestamp''<sup>''1,6''</sup> | | bgcolor="#cccccc" | ''Timestamp''<sup>''1,6''</sup> | ||
Line 65: | Line 57: | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
− | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352365 Timestamp without pattern support] | + | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352365 Timestamp without pattern support]<br> |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Blob'' | | bgcolor="#cccccc" | ''Blob'' | ||
Line 72: | Line 63: | ||
| <br> | | <br> | ||
| N/S<br> | | N/S<br> | ||
− | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352367 Blob support] | + | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352367 Blob support]<br> |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Clob'' | | bgcolor="#cccccc" | ''Clob'' | ||
Line 79: | Line 69: | ||
| <br> | | <br> | ||
| N/S<br> | | N/S<br> | ||
− | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352368 Clob support] | + | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352368 Clob support]<br> |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Smallint'' | | bgcolor="#cccccc" | ''Smallint'' | ||
| value<sup>8</sup> | | value<sup>8</sup> | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
| done<br> | | done<br> | ||
Line 92: | Line 80: | ||
| value<sup>8</sup> | | value<sup>8</sup> | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
| done<br> | | done<br> | ||
Line 99: | Line 86: | ||
| value<sup>8</sup> | | value<sup>8</sup> | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
| done<br> | | done<br> | ||
Line 106: | Line 92: | ||
| value<sup>8</sup> | | value<sup>8</sup> | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
| done<br> | | done<br> | ||
Line 113: | Line 98: | ||
| reference | | reference | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
| done<br> | | done<br> | ||
Line 120: | Line 104: | ||
| value<sup>8</sup> | | value<sup>8</sup> | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
| done<br> | | done<br> | ||
Line 127: | Line 110: | ||
| value<sup>8</sup> | | value<sup>8</sup> | ||
| <br> | | <br> | ||
− | |||
| done<br> | | done<br> | ||
| done<br> | | done<br> | ||
Line 135: | Line 117: | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
− | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352370 Generic number support] | + | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352370 Generic number support]<br> |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Bytes(N)''<sup>''4''</sup> | | bgcolor="#cccccc" | ''Bytes(N)''<sup>''4''</sup> | ||
Line 142: | Line 123: | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
− | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352371 Bytes with length support] | + | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352371 Bytes with length support]<br> |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Bytes''<sup>''5''</sup> | | bgcolor="#cccccc" | ''Bytes''<sup>''5''</sup> | ||
Line 149: | Line 129: | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
− | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352372 Bytes without length support] | + | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352372 Bytes without length support]<br> |
− | + | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Arraydictionary''<br> | | bgcolor="#cccccc" | ''Arraydictionary''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Char''<br> | | bgcolor="#cccccc" | ''Char''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Dbchar''<br> | | bgcolor="#cccccc" | ''Dbchar''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Mbchar''<br> | | bgcolor="#cccccc" | ''Mbchar''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Unicode''<br> | | bgcolor="#cccccc" | ''Unicode''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Hex''<sup>''4''</sup><br> | | bgcolor="#cccccc" | ''Hex''<sup>''4''</sup><br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Time''<sup>''1''</sup><br> | | bgcolor="#cccccc" | ''Time''<sup>''1''</sup><br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Interval''<sup>''1''</sup><br> | | bgcolor="#cccccc" | ''Interval''<sup>''1''</sup><br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Bin''<br> | | bgcolor="#cccccc" | ''Bin''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Num''<br> | | bgcolor="#cccccc" | ''Num''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Numc''<br> | | bgcolor="#cccccc" | ''Numc''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Pacf''<br> | | bgcolor="#cccccc" | ''Pacf''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Money''<br> | | bgcolor="#cccccc" | ''Money''<br> | ||
− | |||
| <br> | | <br> | ||
− | | | + | | <br> |
| N/S | | N/S | ||
| N/S | | N/S | ||
Line 254: | Line 220: | ||
#As in RBD, it's OK to only specify the length when using the decimal type. Decimal(N) is internally mapped to decimal(N,0). | #As in RBD, it's OK to only specify the length when using the decimal type. Decimal(N) is internally mapped to decimal(N,0). | ||
#Value types may be nullable. | #Value types may be nullable. | ||
− | #Value typed variables may be declared with a question mark following the name of the type to indicate that they're nullable. <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">Nullability means that a variable may really be null. It's not an "I'm null" flag like in RBD. A NullValueException will be thrown if you try to access a field or function of a null variable, even a record. A NullValueException will be thrown if a null variable is an operand to a math operator, an array access, a substring access, a comparison, or a bitwise operator.</span> The string concatenation operators will work the same as in RBD with respect to nulls. :: treats null as the empty string, and ?: results in null if either operand is null. <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">A question mark won't be allowed on the second operand of the AS and ISA operators (the name of the type).</span> <br> | + | #Value typed variables may be declared with a question mark following the name of the type to indicate that they're nullable. <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">Nullability means that a variable may really be null. It's not an "I'm null" flag like in RBD. A NullValueException will be thrown if you try to access a field or function of a null variable, even a record. A NullValueException will be thrown if a null variable is an operand to a math operator, an array access, a substring access, a comparison, or a bitwise operator.</span> The string concatenation operators will work the same as in RBD with respect to nulls. :: treats null as the empty string, and ?: results in null if either operand is null. <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">A question mark won't be allowed on the second operand of the AS and ISA operators (the name of the type).</span> <br> |
=== More about the Bytes type === | === More about the Bytes type === |
Revision as of 15:14, 19 July 2011
Please see the parent of this page, EDT:EGL Language.
Primitive Types (Table 3)
Primitive Types | Value or Reference?9 | Core | JavaScript Nullable Types |
Java |
Any | reference | |
|
done |
Boolean | value8 | |
done |
done |
Dictionary | reference | |
Dictionary Support |
Dictionary Support |
String(N) | reference | |
|
Limited string support |
String | reference | |
done |
done |
Date1 |
value |
|
|
|
Timestamp(pattern)1 | value8 | |
|
Timestamp with pattern support |
Timestamp1,6 | reference | |
|
Timestamp without pattern support |
Blob | reference | |
N/S |
Blob support |
Clob | reference | |
N/S |
Clob support |
Smallint | value8 | |
done |
done |
Int | value8 | |
done |
done |
Bigint | value8 | |
done |
done |
Decimal(N,M)7 | value8 | |
done |
done |
Decimal2 | reference | |
done |
done |
Float | value8 | |
done |
done |
Smallfloat | value8 | |
done |
done |
Number3 | reference | |
done |
Generic number support |
Bytes(N)4 | value8 | |
|
Bytes with length support |
Bytes5 | reference | |
|
Bytes without length support |
Arraydictionary |
|
|
N/S | N/S |
Char |
|
|
N/S | N/S |
Dbchar |
|
|
N/S | N/S |
Mbchar |
|
|
N/S | N/S |
Unicode |
|
|
N/S | N/S |
Hex4 |
|
|
N/S | N/S |
Time1 |
|
|
N/S | N/S |
Interval1 |
|
|
N/S | N/S |
Bin |
|
|
N/S | N/S |
Num |
|
|
N/S | N/S |
Numc |
|
|
N/S | N/S |
Pacf |
|
|
N/S | N/S |
Money |
|
|
N/S | N/S |
Notes on Table 3
- Date and timestamp are the only supported date/time types. Use a timestamp in place of RBD's time, and use a numeric type in place of RBD's interval.
- Decimal with no length or decimals is a reference type with an immutable value.
- Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.
- Bytes(N) is a value type similar to RBD's hex. N indicates the number of bytes in the value. (In RBD, the length of a hex is the number of nibbles not the nubmer of bytes.)
- Bytes with no length is a reference type with an immutable value of any length.
- Timestamp with no pattern is a reference type in EDT. It can hold any timestamp value.
- As in RBD, it's OK to only specify the length when using the decimal type. Decimal(N) is internally mapped to decimal(N,0).
- Value types may be nullable.
- Value typed variables may be declared with a question mark following the name of the type to indicate that they're nullable. Nullability means that a variable may really be null. It's not an "I'm null" flag like in RBD. A NullValueException will be thrown if you try to access a field or function of a null variable, even a record. A NullValueException will be thrown if a null variable is an operand to a math operator, an array access, a substring access, a comparison, or a bitwise operator. The string concatenation operators will work the same as in RBD with respect to nulls. :: treats null as the empty string, and ?: results in null if either operand is null. A question mark won't be allowed on the second operand of the AS and ISA operators (the name of the type).
More about the Bytes type
Bytes is meant to hold data with no particular format.
Assignment between two bytes values with no length is a reference assignment. Assignment between two bytes values when one or both has a length is a value assignment (data is copied). If the source is longer bytes on its right side are truncated. If the source is shorter then we don't add padding: we just don't update what was there before. For example if your bytes(3) is 0x123456 and you assign it a bytes(1) value of 0x99 then the bytes(3) ends up with 0x993456.
In order for two bytes values to be compared, they must both have a size, and the sizes must be equal. The comparison is done one byte at a time, from left to right, until a difference is found. The operand with a one instead of a zero is greater.
The bytes type supports the substring operator. The type of the result is bytes (with no length).