Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EDT:EGL Language Primitive Types"

(Primitive Types (Table 3))
Line 3: Line 3:
 
== Primitive Types (Table 3)  ==
 
== Primitive Types (Table 3)  ==
  
{| width="400" cellspacing="1" cellpadding="1" border="1" style=""
+
{| cellspacing="1" cellpadding="1" border="1" width="400" style=""
 
|-
 
|-
 
| bgcolor="#999999" align="center" | '''''Primitive Types'''''  
 
| bgcolor="#999999" align="center" | '''''Primitive Types'''''  
Line 16: Line 16:
 
| <br>  
 
| <br>  
 
| <br>  
 
| <br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Boolean''  
 
| bgcolor="#cccccc" | ''Boolean''  
Line 23: Line 23:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Dictionary''  
 
| bgcolor="#cccccc" | ''Dictionary''  
Line 44: Line 44:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Timestamp(''pattern'')<sup>1</sup>''  
 
| bgcolor="#cccccc" | ''Timestamp(''pattern'')<sup>1</sup>''  
Line 79: Line 79:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Int''  
 
| bgcolor="#cccccc" | ''Int''  
Line 86: Line 86:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Bigint''  
 
| bgcolor="#cccccc" | ''Bigint''  
Line 93: Line 93:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Decimal(N,M)''<sup>''7''</sup>  
 
| bgcolor="#cccccc" | ''Decimal(N,M)''<sup>''7''</sup>  
Line 100: Line 100:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Decimal<sup>2</sup><sup></sup>''  
 
| bgcolor="#cccccc" | ''Decimal<sup>2</sup><sup></sup>''  
Line 107: Line 107:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Float''  
 
| bgcolor="#cccccc" | ''Float''  
Line 114: Line 114:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Smallfloat''  
 
| bgcolor="#cccccc" | ''Smallfloat''  
Line 121: Line 121:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
| <br>
+
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Number''<sup>''3''</sup>  
 
| bgcolor="#cccccc" | ''Number''<sup>''3''</sup>  
| <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>  
Line 247: Line 247:
  
 
#Timestamp is the only supported date/time type. Use it in place of RBD's date, time, and interval.  
 
#Timestamp is the only supported date/time type. Use it in place of RBD's date, time, and interval.  
#Decimal with no length or decimals is a reference type with an immutable value.
+
#Decimal with no length or decimals is a reference type with an immutable value.  
 
#<span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.</span>  
 
#<span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.</span>  
 
#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(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.)  

Revision as of 12:24, 18 July 2011

Please see the parent of this page, EDT:EGL Language.

Primitive Types (Table 3)

Primitive Types Value or Reference? Core JavaScript
Nullable Types
Java Debug
Any reference

done
done
Boolean value8
done
done
done
Dictionary reference
Dictionary Support


String(N) reference



String reference
done
done
done
Timestamp(pattern)1 value8



Timestamp1,6 reference



Blob reference
N/S


Clob reference
N/S


Smallint value8
done
done
done
Int value8
done
done
done
Bigint value8
done
done
done
Decimal(N,M)7 value8
done
done
done
Decimal2 reference
done
done
done
Float value8
done
done
done
Smallfloat value8
done
done
done
Number3 reference
done


Bytes(N)4 value8



Bytes5 reference



Arraydictionary

N/S N/S N/S
Char

N/S N/S N/S
Dbchar

N/S N/S N/S
Mbchar

N/S N/S N/S
Unicode

N/S N/S N/S
Hex4

N/S N/S N/S
Date1

N/S N/S N/S
Time1

N/S N/S N/S
Interval1

N/S N/S N/S
Bin

N/S N/S N/S
Num

N/S N/S N/S
Numc

N/S N/S N/S
Pacf

N/S N/S N/S
Money

N/S N/S N/S

Notes on Table 3

  1. Timestamp is the only supported date/time type. Use it in place of RBD's date, time, and interval.
  2. Decimal with no length or decimals is a reference type with an immutable value.
  3. Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.
  4. 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.)
  5. Bytes with no length is a reference type with an immutable value of any length.
  6. Timestamp with no pattern is a reference type in EDT.  It can hold any timestamp value.
  7. 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).
  8. Value types may be nullable.

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).

Back to the top