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 |
---|---|
Corresponds to the alpha component of a color operand. |
|
Represents the area of a rect operand. |
|
Corresponds to the blue component of a color operand. |
|
Represents the position in the center of a rect 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. |
|
Represents the number of characters within a string 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 size of a rect operand or in case of an array as operand, determines its capacity. |
|
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 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 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. |