Programming language Chora: Instant properties
Instant properties provide a simple way to evaluate and modify operands of Chora own data types. One group of them allow a direct access to the elements of a data type. For example, you use the instant properties red, green, blue and alpha to access and modify the homonymous components of a color operand. Other instant properties, in turn, provide a convenient interface to perform more extensive operations on an operand. For example, the data type rect implements an instant property center, which calculates from the rectangle's current coordinates its center position. The rectangle itself doesn't store the center value.
Every instant property is strictly associated to the data type in context of which you can evaluate or modify it. For example, the instant property red can be used in context of a color operand but trying to evaluate red in context of a rect operand will report a Chora compiler error. Following instant properties are available:
Instant property name |
Short description |
---|---|
Represents the absolute value of the given int8, int16, int32, int64, float, point or rect operand. |
|
Corresponds to the alpha component of a color operand. |
|
Represents the area of a rectangle with size specified in a point or rect operand. |
|
Corresponds to the blue component of a color operand. |
|
Represents the next highest integer value of a float operand. |
|
Represents the position in the center of a rect operand. |
|
Represents the next lowest integer value of a float operand. |
|
Represents the fractional part of a float operand. |
|
Corresponds to the green component of a color operand. |
|
Represents the height of a rect operand. |
|
Reflects the status of a rect, styles or user-defined set operand. |
|
Verifies the Infinity (+INF or -INF) status of a float operand. |
|
Verifies the Negative Infinity (-INF) status of a float operand. |
|
Verifies the Positive Infinity (+INF) status of a float operand. |
|
Verifies the Not a Number (NAN) status of a float operand. |
|
Represents the number of characters within a string operand or the length of vector stored in a point operand. |
|
Represents the lower case version of a string or char operand. |
|
Represents a rect operand with its origin reset to <0,0>. |
|
Represents the origin position of a rect operand. |
|
Corresponds to the position of the top-left corner of a rect operand. |
|
Corresponds to the position of the bottom-right corner of a rect operand. |
|
Corresponds to the red component of a color operand. |
|
Represents the float operand rounded to the next lowest or highest integer value. |
|
Represents the size of a rect operand or in case of an array as operand, determines its capacity. |
|
Represents the float operand rounded by removing the fractional part. |
|
Represents the absolute value of the given int8, int16, int32 or int64 operand. |
|
Represents the upper case version of a string or char operand. |
|
Represents the width of a rect operand. |
|
Corresponds to the x coordinate of a point or rect operand. |
|
Corresponds to the x coordinate of the top-left corner of a rect operand. |
|
Corresponds to the x coordinate of the bottom-right corner of a rect operand. |
|
Corresponds to the y coordinate of a point or rect operand. |
|
Corresponds to the y coordinate of the top-left corner of a rect operand. |
|
Corresponds to the y coordinate of the bottom-right corner of a rect operand. |